Skip to content

feat(modules): add encoded word matcher option#325

Open
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:feat/encoded-word-matcher
Open

feat(modules): add encoded word matcher option#325
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:feat/encoded-word-matcher

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

word matchers gain an optional encoding of hex or base64. when set, each
configured plaintext word is rendered into that encoding before matching,
so a marker that appears encoded in a response (a base64 blob, a hex dump)
can be matched by its known plaintext form. an unset encoding keeps the
existing literal behaviour byte for byte. an unknown encoding value is
rejected at module load.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 4, 2026 01:11
@github-actions github-actions Bot added modules changes to scan modules tests test changes size/m <200 lines changed labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

pr summary

4 files changed (+122 -8)

category files
go source 4
tests 1

@codecov-commenter

codecov-commenter commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@a38ba0a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/modules/executor.go 91.66% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #325   +/-   ##
=======================================
  Coverage        ?   64.98%           
=======================================
  Files           ?       88           
  Lines           ?     7887           
  Branches        ?        0           
=======================================
  Hits            ?     5125           
  Misses          ?     2369           
  Partials        ?      393           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TBX3D
TBX3D force-pushed the feat/encoded-word-matcher branch from ce7df9c to fa716bc Compare July 9, 2026 23:52

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean. unset path stays byte-for-byte and the unknown-encoding reject reuses the validateMatchers load-time gate, exactly where it belongs. good reuse of encodeMatcherWord("") as the validator too.

two sharp edges to note in the module docs, both false-negative only so not blocking: base64 goes through StdEncoding, so it only matches when the marker is 3-byte aligned in the source blob, and it won't catch base64url (-_ , the JWT/web variant). and hex.EncodeToString is lowercase while checkWords is case-sensitive, so an uppercase hex dump slips past. fine for the opt-in heuristic, just don't want a rule author expecting it to catch a marker mid-blob.

in.

@vmfunc
vmfunc enabled auto-merge (squash) July 22, 2026 22:40
word matchers gain an optional encoding of hex or base64. when set, each
configured plaintext word is rendered into that encoding before matching,
so a marker that appears encoded in a response (a base64 blob, a hex dump)
can be matched by its known plaintext form. an unset encoding keeps the
existing literal behaviour byte for byte. an unknown encoding value is
rejected at module load.
auto-merge was automatically disabled July 23, 2026 00:10

Head branch was pushed to by a user without write access

@TBX3D
TBX3D force-pushed the feat/encoded-word-matcher branch from 73e7d6e to 9553c40 Compare July 23, 2026 00:10
@TBX3D

TBX3D commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

rebased. main added the range matcher and word case-insensitivity in the meantime, so the merge is a union rather than a replay: validateMatchers is one switch over favicon, range and word instead of the two ifs it grew from, Matcher carries Encoding alongside Source/Min/Max/CaseInsensitive, and the word matcher encodes first and then passes m.CaseInsensitive to checkWords. the merge commit is gone, so this is a single commit now.

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

Labels

modules changes to scan modules size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants