Skip to content

surface IdentifyOnly results from cookies and manual product mode#393

Merged
liquidsec merged 2 commits intodevfrom
fix-cookies-identifyonly-fallback
May 9, 2026
Merged

surface IdentifyOnly results from cookies and manual product mode#393
liquidsec merged 2 commits intodevfrom
fix-cookies-identifyonly-fallback

Conversation

@liquidsec
Copy link
Copy Markdown
Collaborator

Summary

Closes the gap reported on main @ 6a7aa49 where badsecrets -u <laravel-protected-site> printed "No secrets found :(" even though the Laravel cookie was correctly identified — only the APP_KEY wasn't in the wordlist.

What changed

  • carve() cookies branch: adds an IdentifyOnly fallback gated on validate_carve, mirroring the headers and body branches.
  • check_all_modules() (the badsecrets <product> path): now runs identify() after check_secret misses and returns a list of dicts (each tagged SecretFound or IdentifyOnly), matching carve_all_modules().
  • carve_all_modules() and check_all_modules() both suppress every IdentifyOnly result whenever any SecretFound exists — actionable hits outrank recognition-only candidates.
  • cli.py product-mode iterates the new list and dispatches SecretFound vs IdentifyOnly to the appropriate report. URL-mode unchanged.

Safety: identify_regex audit

All eight modules whose carve_locations includes cookies (laravel, django, flask, rack2, yii2, express, shiro, ltpa) ship a specific identify_regex — none rely on the default r".+". The validate_carve gate is the kill switch if any future module forgets to override.

bbot compatibility

bbot only imports carve_all_modules, which already returns a list. No changes needed on the bbot side.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (09956f4) to head (e96fc52).
⚠️ Report is 10 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff             @@
##              dev      #393      +/-   ##
===========================================
+ Coverage   99.85%   100.00%   +0.14%     
===========================================
  Files          31        30       -1     
  Lines        3412      3084     -328     
===========================================
- Hits         3407      3084     -323     
+ Misses          5         0       -5     

☔ View full report in Codecov by Sentry.
📢 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 cookies branch of carve() previously only emitted SecretFound, with no
IdentifyOnly fallback like the headers and body branches had. Likewise,
check_all_modules (the manual / 'badsecrets <product>' path) only ran
check_secret. As a result, recognizable cryptographic products with unknown
keys were silently dropped — most visibly Laravel cookies (carve_locations
is just ('cookies',)).

Both paths now mirror the headers/body symmetry:
- carve() cookies branch falls back to identify() when check_secret misses,
  gated on validate_carve.
- check_all_modules returns a list of dicts (now including IdentifyOnly hits),
  matching carve_all_modules's shape.
- carve_all_modules and check_all_modules suppress all IdentifyOnly results
  when any module produces a SecretFound — actionable hits outrank
  recognition-only candidates.
- cli.py product-mode iterates the new list and dispatches SecretFound vs
  IdentifyOnly to the appropriate report; URL-mode unaffected.

bbot is unaffected: it imports only carve_all_modules and consumes the list
return that already existed.
@liquidsec liquidsec force-pushed the fix-cookies-identifyonly-fallback branch from 0cca1b1 to 34da87e Compare May 9, 2026 18:38
@liquidsec liquidsec merged commit b13587a into dev May 9, 2026
3 of 8 checks passed
@liquidsec liquidsec mentioned this pull request May 9, 2026
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.

2 participants