Skip to content

fix(scan): percent-encode dork queries before search#327

Open
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:fix/dork-query-encoding
Open

fix(scan): percent-encode dork queries before search#327
TBX3D wants to merge 1 commit into
vmfunc:mainfrom
TBX3D:fix/dork-query-encoding

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

the google-search client only swaps spaces for '+' and drops the term
into the query string verbatim, so a dork carrying a raw '#' or '&' cut
the request url short at the fragment or split it into stray query
params. the search then ran against a fragment of the intended dork.
encode the term up front so the whole dork survives.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 4, 2026 01:11
@github-actions github-actions Bot added scan changes to scan engine 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

2 files changed (+95 -5)

category files
go source 2
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 40.00000% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/scan/dork.go 40.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #327   +/-   ##
=======================================
  Coverage        ?   54.74%           
=======================================
  Files           ?       81           
  Lines           ?     6876           
  Branches        ?        0           
=======================================
  Hits            ?     3764           
  Misses          ?     2843           
  Partials        ?      269           

☔ 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.

the google-search client only swaps spaces for '+' and drops the term
into the query string verbatim, so a dork carrying a raw '#' or '&' cut
the request url short at the fragment or split it into stray query
params. the search then ran against a fragment of the intended dork.
encode the term up front so the whole dork survives.
@TBX3D
TBX3D force-pushed the fix/dork-query-encoding branch from e368f7c to 24bf8ee Compare July 9, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants