Skip to content

Commit 72c97cd

Browse files
manshusainishabBornunique911
authored andcommitted
GSoC 2026 Module B — Week 4: evaluation harness + recall-first gold corrections + prompt tuning (OWASP#976)
* feat(module-b): add Stage 2 evaluation harness * chore(module-b): align gold labels to recall-first (worked examples + heading-only) * feat(module-b): sharpen Stage 2 prompt for organizational meta-content * fix(module-b): guard eval report against empty dataset
1 parent 780f303 commit 72c97cd

4 files changed

Lines changed: 353 additions & 22 deletions

File tree

application/tests/noise_filter/fixtures/labeled_data.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"id": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md",
2828
"path": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md"
2929
},
30-
"label": "KNOWLEDGE",
31-
"label_rationale": "",
30+
"label": "NOISE",
31+
"label_rationale": "Heading/title-only chunk with no methodology body [heading-only tiny-chunk -> NOISE, consistent rule 2026-07-03; was KNOWLEDGE]",
3232
"labeled_by": "manshusainishab",
3333
"labeled_at": "2026-05-29"
3434
},
@@ -96,8 +96,8 @@
9696
"id": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md",
9797
"path": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md"
9898
},
99-
"label": "UNCERTAIN",
100-
"label_rationale": "borderline: structured as an example but is the primary methodology unit for testing GitHub-specific subdomain takeover. Prompt iteration must clarify whether canonical WSTG worked examples count as KNOWLEDGE or as \"additional example\" NOISE.",
99+
"label": "KNOWLEDGE",
100+
"label_rationale": "Worked attack-scenario walkthrough (GitHub subdomain takeover) -- security content [recall-first correction 2026-07-03; was UNCERTAIN]",
101101
"labeled_by": "manshusainishab",
102102
"labeled_at": "2026-05-29"
103103
},
@@ -131,8 +131,8 @@
131131
"id": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md",
132132
"path": "document/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/10-Test_for_Subdomain_Takeover.md"
133133
},
134-
"label": "UNCERTAIN",
135-
"label_rationale": "same case as chunk 3 — scenario walkthrough under Summary. Linked for prompt-iteration consistency.",
134+
"label": "KNOWLEDGE",
135+
"label_rationale": "Worked attack-scenario walkthrough (expired-domain subdomain takeover) [recall-first correction 2026-07-03; was UNCERTAIN]",
136136
"labeled_by": "manshusainishab",
137137
"labeled_at": "2026-05-29"
138138
},
@@ -548,8 +548,8 @@
548548
"id": "document/4-Web_Application_Security_Testing/04-Authentication_Testing/11-Testing_Multi-Factor_Authentication.md",
549549
"path": "document/4-Web_Application_Security_Testing/04-Authentication_Testing/11-Testing_Multi-Factor_Authentication.md"
550550
},
551-
"label": "KNOWLEDGE",
552-
"label_rationale": "",
551+
"label": "NOISE",
552+
"label_rationale": "Heading/title-only chunk with no methodology body [heading-only tiny-chunk -> NOISE, consistent rule 2026-07-03; was KNOWLEDGE]",
553553
"labeled_by": "manshusainishab",
554554
"labeled_at": "2026-05-29"
555555
},
@@ -1748,8 +1748,8 @@
17481748
"id": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md",
17491749
"path": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md"
17501750
},
1751-
"label": "KNOWLEDGE",
1752-
"label_rationale": "",
1751+
"label": "NOISE",
1752+
"label_rationale": "Heading/title-only chunk with no methodology body [heading-only tiny-chunk -> NOISE, consistent rule 2026-07-03; was KNOWLEDGE]",
17531753
"labeled_by": "manshusainishab",
17541754
"labeled_at": "2026-05-29"
17551755
},
@@ -1851,8 +1851,8 @@
18511851
"id": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md",
18521852
"path": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md"
18531853
},
1854-
"label": "KNOWLEDGE",
1855-
"label_rationale": "",
1854+
"label": "NOISE",
1855+
"label_rationale": "Heading/title-only chunk with no methodology body [heading-only tiny-chunk -> NOISE, consistent rule 2026-07-03; was KNOWLEDGE]",
18561856
"labeled_by": "manshusainishab",
18571857
"labeled_at": "2026-05-29"
18581858
},
@@ -1887,8 +1887,8 @@
18871887
"id": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md",
18881888
"path": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md"
18891889
},
1890-
"label": "UNCERTAIN",
1891-
"label_rationale": "DOM sinks (innerHTML/outerHTML) framed as examples but functionally an attack-vector catalog. Same pattern as chunks 3-4; needs prompt clarification on canonical-primitive vs illustrative-example.",
1890+
"label": "KNOWLEDGE",
1891+
"label_rationale": "Catalog of dangerous DOM sinks (innerHTML/outerHTML) = XSS attack vectors [recall-first correction 2026-07-03; was UNCERTAIN]",
18921892
"labeled_by": "manshusainishab",
18931893
"labeled_at": "2026-05-29"
18941894
},
@@ -1923,8 +1923,8 @@
19231923
"id": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md",
19241924
"path": "cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.md"
19251925
},
1926-
"label": "UNCERTAIN",
1927-
"label_rationale": "same case as chunk 55 — DOM sinks framed as examples. Linked for prompt-iteration consistency.",
1926+
"label": "KNOWLEDGE",
1927+
"label_rationale": "Catalog of dangerous DOM methods (document.write/writeln) = XSS attack vectors [recall-first correction 2026-07-03; was UNCERTAIN]",
19281928
"labeled_by": "manshusainishab",
19291929
"labeled_at": "2026-05-29"
19301930
},
@@ -3068,8 +3068,8 @@
30683068
"id": "Website/content/en/user-day/owasp-samm-to-the-rescue.md",
30693069
"path": "Website/content/en/user-day/owasp-samm-to-the-rescue.md"
30703070
},
3071-
"label": "UNCERTAIN",
3072-
"label_rationale": "talk abstract with substantive attack content (AWS CodeBuild StartBuild pipeline poisoning) wrapped in event-page framing. Prompt iteration must clarify whether talk teasers with named attack techniques count as KNOWLEDGE.",
3071+
"label": "KNOWLEDGE",
3072+
"label_rationale": "Talk abstract naming a concrete technique (CodeBuild pipeline poisoning) [recall-first correction 2026-07-03; was UNCERTAIN]",
30733073
"labeled_by": "manshusainishab",
30743074
"labeled_at": "2026-05-29"
30753075
},

application/tests/noise_filter/llm_classifier_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_all_few_shot_examples_embedded(self) -> None:
8383
def test_few_shot_label_distribution(self) -> None:
8484
labels = [e["label"] for e in FEW_SHOT_EXAMPLES]
8585
self.assertEqual(labels.count("KNOWLEDGE"), 5)
86-
self.assertEqual(labels.count("NOISE"), 3)
86+
self.assertEqual(labels.count("NOISE"), 5)
8787
self.assertEqual(labels.count("UNCERTAIN"), 2)
8888

8989

application/utils/noise_filter/prompts.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@
2727
configurations, EVEN clarifications, typo fixes, expanded examples, \
2828
restatements of well-known material, added reference links, or restructured \
2929
security sections. When in doubt, choose KNOWLEDGE.
30-
- NOISE: ONLY chunks with no security signal at all -- sponsorship pages, \
31-
meeting notes, CI/build configuration, release tags, website layout, \
32-
contributor onboarding, project governance.
30+
- NOISE: ONLY chunks with no security-knowledge content at all -- sponsorship \
31+
pages, meeting notes, CI/build configuration, release tags, website layout, \
32+
contributor onboarding, project governance. This includes content *about* a \
33+
security project rather than security knowledge itself: version/release \
34+
announcements, licenses, translation notes, citation/reference-format \
35+
instructions, tables of contents, project titles/banners, and event/talk \
36+
teasers -- even when they name a security standard or project (e.g. "ASVS", \
37+
"SAMM"). Naming a security project is not the same as containing security \
38+
knowledge.
3339
- UNCERTAIN: only when genuinely 50/50 even after applying the bias above. \
3440
This label is rare.
3541
@@ -133,6 +139,33 @@
133139
"confidence": 0.95,
134140
"reasoning": "CI release-tagging workflow; build infrastructure, not security knowledge.",
135141
},
142+
{
143+
"heading_path": [
144+
"OWASP Application Security Verification Standard",
145+
"Latest Stable Version",
146+
],
147+
"text": (
148+
"The latest stable version is 5.0.0 (dated May 2025), available as a "
149+
"PDF and in the GitHub repository. See the release notes for changes "
150+
"since 4.0."
151+
),
152+
"label": "NOISE",
153+
"confidence": 0.9,
154+
"reasoning": "Version/release announcement about a security standard -- content about the project, not security knowledge.",
155+
},
156+
{
157+
"heading_path": [
158+
"OWASP Application Security Verification Standard",
159+
"License",
160+
],
161+
"text": (
162+
"The entire project content is under the Creative Commons "
163+
"Attribution-Share Alike v4.0 license."
164+
),
165+
"label": "NOISE",
166+
"confidence": 0.95,
167+
"reasoning": "Licensing information about a security project -- organizational, no security methodology.",
168+
},
136169
{
137170
"heading_path": ["About"],
138171
"text": (

0 commit comments

Comments
 (0)