Repository navigation
Conversation
A bawbel-ignore comment is free text: ids, a reason, a reviewer. The engines read it like any other line, so a reason that quoted the pattern it suppressed created a second finding that the comment did not cover, and a block comment's own text was listed as a suppressed finding. The text of bawbel-ignore and bawbel-accept comments (also -start and -end) is replaced with spaces before the engines run. Newlines and columns are kept, so line numbers do not move; the suppression parsers still read the original content. Only when suppressions are honored: under --no-ignore the comment is ordinary text and is scanned. Only well-formed directives are masked. An HTML comment must close within 1000 characters and hold no second opener, a line marker must start the line or follow whitespace, and metadata lines count only right after a directive, so an unterminated or hostile comment cannot swallow content. bawbel.yml and .bawbelignore are the scanner's own configuration. They are skipped at the root of a directory scan and dropped from the self-scan targets; the same names deeper, or named on the command line, are still scanned. Closes #122 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P Signed-off-by: chaksaray <chaksaray@gmail.com>
scan() calls the LLM engine from two places. The second runs when Magika reports a content-type finding that is not dangerous, and no test reached it, so a change there to pass the raw text went unnoticed. The test now runs both paths, with and without such a finding, in honored and audit mode. With the second call changed to pass the raw content it fails. Refs #122 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P Signed-off-by: chaksaray <chaksaray@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122
What and why
A suppression comment is free text: ids, a reason, a reviewer. The pattern engines read it like any other line, so the comment could raise findings of its own, and suppressing one finding could create another.
Reproduced on
develop(e0ae94d) before changing anything. The runbook's own snippet does not trigger anything, so the issue gives working cases:The text of
bawbel-ignoreandbawbel-acceptcomments (also-startand-end) is now replaced with spaces before the engines run, inscanner/core/preprocessor.py. Newlines and columns are kept, so finding line numbers do not move.scan()passes the masked text to the pattern, YARA, Semgrep, LLM and sandbox engines and leaves the original for the suppression parsers, so every suppression keeps working.How it is kept narrow:
--no-ignore(audit mode) a comment is ordinary text and is scanned in full<!--. A#or//marker must start the line or follow whitespace, sohttps://bawbel-ignore.example/is not a comment.# reason:style lines count as metadata only straight after a directive. An unterminated or oversized comment is scanned, so the mask cannot swallow content after it. The limit isSUPPRESSION_COMMENT_MAX_CHARSinscanner/config/default.pyWhy this does not widen what a hostile file can hide: when suppressions are honored, a file can already suppress findings on its own line with
bawbel-ignore, or wrap anything inbawbel-ignore-startand-end. Masking the comment text adds no capability beyond that, and--no-ignoreis still the audit mode. This is the one design judgement in the PR, so it is spelled out for review.bawbel.ymland.bawbelignore: neither raises findings today, even with attack text in a.bawbelignorecomment (checked), and nothing in the scanner readsbawbel.ymlas configuration (bawbel initonly writes it). The acceptance asked for them to be excluded from self-scan, socollect_filesskips them at the root of a directory scan (SCANNER_CONFIG_FILES) andscripts/self_scan.shdropsbawbel.ymlfrom its targets. The same names deeper in a tree, or named on the command line, are still scanned, so a hostile pack cannot hide a payload by naming a filebawbel.yml.Output contract impact
Fields added: none
Fields renamed: none
Fields removed: none
Findings and suppressed findings that existed only because of a suppression comment's text no longer appear in default mode. No field changes.
Checks
findings 7 max CRITICAL risk 9.8671 passed in 303.79s(35 are new, intests/unit/test_suppression_text_not_scanned.py)exit=0, 14 hooks (black, flake8, bandit, the self-scan and the full suite among them)bash scripts/self_scan.shexits 0tests/fixtures/skills/clean/self_referential_suppression.md: no findings by default, andAVE-2026-00001andAVE-2026-00007appear under--no-ignoreThe tests failed before the fix (the new names did not exist, so collection errored) and pass after. Eleven mutations of the implementation, each run against the final 35 tests, are all caught:
The LLM engine needs an API key and cannot run here, so a test captures what
run_llm_scanreceives on both call sites inscan(): the usual path, and the path taken when Magika reports a content-type finding that is not dangerous. That second call was uncovered at first; the last mutation above found it.Not changed
bawbel acceptoutput and the JSON audit trail: unchanged, since those read the original content*,#,//or<!--as part of the comment. That is why masking uses a stricter rule: a bullet after a directive stays content. Found, not changedMerging with other scanner PRs
Trial merges (git merge, no conflicts) with #117, #119 and #121. The CHANGELOG entry sits at the bottom of
[Unreleased]for that reason.🤖 Generated with Claude Code
https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P