Skip to content

fix(cbh): triage Q3 ignores unverified scope, Q7 matches "clickjacking" - #197

Closed
Ethereal49 wants to merge 1 commit into
elementalsouls:mainfrom
Ethereal49:fix/triage-q3-q7-negation-196
Closed

Ethereal49 wants to merge 1 commit into
elementalsouls:mainfrom
Ethereal49:fix/triage-q3-q7-negation-196

Conversation

@Ethereal49

@Ethereal49 Ethereal49 commented Nov 21, 2026 •

Copy link
Copy Markdown

What does this change?

Fixes cbh triage so Q3 stops answering YES when the finding itself says the asset is unverified or out of scope, and Q7 catches the unhyphenated clickjacking. Closes #196.

  • Q3: a scope/asset hit is discarded when a scope, target: or asset: line contains a negation phrase — out of scope, not in scope, not verified, unverified, unknown, possibly, maybe, unclear. The check is limited to those lines, so unrelated wording such as Impact: unclear or previously unknown still passes Q3 (a whole-document match would kill valid findings).
  • Q7: clickjacking added next to the existing click-jacking; both still match.
  • Q1, Q2, Q4–Q6, the verdict thresholds and exit codes are unchanged.

Repro from the issue now reports ✗ Q3 … NO — no supporting evidence in finding and ✗ Q7 … NO — finding matches never-submit category instead of both ✓.

Type

  • New skill
  • Improvement to an existing skill
  • Docs / examples
  • Tooling / scripts / CI
  • Other: CLI bug fix in cbh/cli.py

Checklist

  • No client/engagement data — test fixtures use example.com only.
  • python3 scripts/lint_skills.py passes locally (0 errors, 11 pre-existing length warnings; no skills touched).
  • For a new skill … — N/A
  • For a new skill: README/USAGE decision tree — N/A
  • Sources cited — the issue's repro is the source; no third-party material adapted.
  • Cross-references — N/A (no skill content changed).

Anything reviewers should know?

Tests: python3 -m unittest tests.test_triage (9 OK), python3 -m unittest discover -s tests (69 OK), python3 -m unittest discover -s engine (35 OK), python3 scripts/scan_identifiers.py (0 matches). CI on this branch had not run when the PR was opened — not claimed.

The negation list deliberately includes soft words (unknown, possibly, unclear) because the issue asks for them; anchoring them to scope lines is what keeps the gate from killing good findings. If you would rather Q3 require an explicit in scope affirmation instead of signal-plus-negation, that is a larger behavior change and I can redo it on request.

Prepared with AI assistance (Codex agent); the diff, tests and repro were run locally as described.

…ing" in Q7

Q3 matched bare words such as "scope" / "asset:", so a finding that says
"Scope: not verified, possibly out of scope" still answered YES. Q3 now
drops the hit when a scope/asset/target line contains a negation phrase
(out of scope, not in scope, not verified, unverified, unknown, possibly,
maybe, unclear). The negation is restricted to those lines so unrelated
wording ("Impact: unclear", "previously unknown") still passes Q3.

Q7's never-submit list only had "click-jacking"; add the unhyphenated
"clickjacking" and keep both. Other questions and exit codes unchanged.

Regression tests in tests/test_triage.py cover the issue repro, an
affirmative in-scope sample, and both clickjacking spellings.
elementalsouls added a commit that referenced this pull request Nov 22, 2026
…CRLF, Windows console, h1 --program (#210)

* fix(cbh): triage gate — real request-target for Q1, scope-negation for Q3, clickjacking for Q7

Three false-verdict paths in the 7-Question Gate, each independently reported:

- Q1 matched a bare method word anywhere in the text, so prose like
  "target application" (contains "get ") or "input validation" passed Q1
  with no request at all. Q1 now needs a method followed by a path or URL
  (or curl / HTTP/1.1). Reported by @dajiaohuang (#209).
- Q7's never-submit list had "click-jacking" but not "clickjacking", so the
  unhyphenated spelling was never killed. Reported by @Ethereal49 (#197).
- Q3 answered YES on any scope/asset wording even when the finding itself
  said "out of scope" / "unverified". A scope/asset line carrying a negation
  no longer counts as in-scope evidence; non-scope lines ("Impact: unclear")
  still don't. Reported by @Ethereal49 (#197).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(cbh): parse finding frontmatter through a leading UTF-8 BOM

A BOM (\ufeff) written by some Windows editors sits before the `---` fence,
so the `^---` frontmatter regex missed it and severity/asset fell back to
defaults. Strip a leading BOM in parse_finding_metadata, the shared chokepoint
for every command that reads a finding, not just `cbh report`.

Reported by @jazzpher (#200).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(cbh): force UTF-8 stdout so Windows cp1252 consoles don't crash

cbh and setup_harness_mcp.py print the gate glyphs (check / cross / arrow /
em-dash) throughout. On a Windows console (cp1252) a bare print() raised
UnicodeEncodeError and the command died mid-run. Reconfigure stdout/stderr to
UTF-8 at both entrypoints, the same fix engine/engine.py:main already uses, so
the whole CLI is covered at one point rather than guarding every print.

Reported by @Sahilkumar-r (#180).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(offensive-osint): filter h1_reference --program by team_handle, not team_id

CompleteHacktivityReportIndex no longer accepts terms: {team_id: ...}, so
--program silently returned nothing. Switch to query_string "team_handle:<h>",
which filters correctly and still accepts sort + pagination (so --program now
composes with --top-voted / --top-bounty). Also: route the lookup progress line
to stderr so --json stdout stays pipeable, and reject an empty --program handle.

Two independent reports converged on this fix: @roonnnnyyyyyy (#206) and
@flipcyde101 (#202).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs(changelog): record the four tooling bugfixes with reporter credits

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(cbh,osint): review follow-ups — Q3 negation, Q1 markdown, CRLF, canonical handle

Adversarial review of the branch surfaced five real defects:

- Q3 _q3_scope_negated matched ANY line containing 'scope' plus a negation,
  so 'Impact: unclear scope of data exposure' wrongly killed an in-scope
  finding. Negation is now evaluated per line: strong phrases ('out of scope')
  disavow anywhere; weak words ('unknown','unclear') only on a scope/asset/
  target line (the key before the colon).
- Q3 negation list was space-only, so the common hyphenated 'out-of-scope'
  slipped through. Hyphens are normalized to spaces before matching.
- Q1 required whitespace between method and path, missing the markdown a PoC
  is usually written in (`GET /x`, **GET** /x, GET `/x`). The separator class
  now allows backticks and bold/italic markers. The prose ceiling
  ('an attacker can get /admin') is marked, not closed — requiring HTTP/ would
  reject the bare 'GET /path' PoC the gate must accept.
- parse_finding_metadata now also normalizes CRLF, so Windows findings (the
  same platform as the BOM in #200) don't skip frontmatter.
- h1_reference --program queried the raw input handle; query_string is
  case-sensitive while TeamLookup is not, so '--program Shopify' could return
  nothing. lookup_program now returns the team record and main uses the
  canonical handle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@elementalsouls

Copy link
Copy Markdown
Owner

Thanks @Ethereal49 — both your catches landed in 9ba66b1 (#210): Q7 now kills the unhyphenated clickjacking, and Q3 no longer treats scope wording as in-scope evidence when the finding disavows the asset (hyphenated out-of-scope included). Review hardened the Q3 check to per-line so Impact: unclear scope… can't false-kill. Credited in CHANGELOG. Closing as built-in-house.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] cbh triage: Q3 answers YES on "possibly out of scope", Q7 misses "clickjacking"

3 participants