From 291846dde5b3d3253cc2ce3caec0e2aecfe9e8d4 Mon Sep 17 00:00:00 2001
From: Tigah <88289044+TBX3D@users.noreply.github.com>
Date: Mon, 22 Jun 2026 16:47:34 -0700
Subject: [PATCH] fix(frameworks): make Phoenix and AdonisJS detection specific
(#153)
the phoenix and adonis detectors matched bare substrings ("phx-", "phoenix",
"adonis") that fire on unrelated pages: a "phx-" css class on a phoenix,
arizona site, or any markup containing the word "adonis". replace them with
markers the frameworks actually emit. phoenix keys on the liveview container
attributes data-phx-main, data-phx-session and data-phx-static; adonis on its
default adonis-session cookie.
this narrows detection: plain (non-liveview) phoenix and session-less adonis
apis are no longer matched. the markers we now key on (liveview's container
attributes, adonis's default session cookie) are ones ordinary prose cannot
forge. each detector gains a true-positive test and a false-positive tripwire.
---
internal/scan/frameworks/detect_test.go | 107 ++++++++++++++++++
internal/scan/frameworks/detectors/backend.go | 9 +-
2 files changed, 111 insertions(+), 5 deletions(-)
diff --git a/internal/scan/frameworks/detect_test.go b/internal/scan/frameworks/detect_test.go
index 19a710a..c592109 100644
--- a/internal/scan/frameworks/detect_test.go
+++ b/internal/scan/frameworks/detect_test.go
@@ -424,6 +424,113 @@ func TestDetectFramework_Joomla(t *testing.T) {
}
}
+func TestDetectFramework_AdonisJS(t *testing.T) {
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Set-Cookie", "adonis-session=s%3Aabc.def; Path=/; HttpOnly")
+ w.WriteHeader(http.StatusOK)
+ w.Write([]byte(`
Welcome`))
+ }))
+ defer server.Close()
+
+ result, err := frameworks.DetectFramework(server.URL, 5*time.Second, "")
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+ if result == nil {
+ t.Fatal("expected result, got nil")
+ }
+ if result.Name != "AdonisJS" {
+ t.Errorf("expected framework 'AdonisJS', got '%s'", result.Name)
+ }
+}
+
+// a cosmetics brand page that merely contains "adonis" in its markup (CSS
+// classes, asset paths, links) must not be fingerprinted as AdonisJS, as the
+// old bare "adonis" substring signature did.
+func TestDetectFramework_AdonisFalsePositive(t *testing.T) {
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusOK)
+ w.Write([]byte(`
+
+
+
+ Adonis Cosmetics
+
+
+
+