Skip to content

leakix: guard parse_results against non-list JSON - #3125

Merged
liquidsec merged 1 commit into
devfrom
leakix-parse-guard
May 30, 2026
Merged

leakix: guard parse_results against non-list JSON#3125
liquidsec merged 1 commit into
devfrom
leakix-parse-guard

Conversation

@liquidsec

Copy link
Copy Markdown
Collaborator

When leakix.net returns an error body that decodes to a JSON string instead of a list — e.g. \"Incorrect API Key\" on an unauthenticated request — parse_results iterates over the string character-by-character and tries entry.get(\"subdomain\", \"\"), raising AttributeError: 'str' object has no attribute 'get'. The exception is caught by the outer try/except in subdomain_enum.query(), so the scan continues, but it adds traceback noise.

Sample from a real scan log:

File "/opt/bbot_dev/bbot/modules/leakix.py", line 43, in parse_results
    subdomain = entry.get("subdomain", "")
AttributeError: 'str' object has no attribute 'get'

Tightens the type check from a truthy test (if json:) to isinstance(json, list) so non-list payloads are quietly ignored.

(The same scenario triggers _api_response_is_success=False and api_request retries, so the error path is well-handled at the request layer; this is just the parse layer being defensive against malformed payloads.)

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Performance Benchmark Report

⚠️ No current benchmark data available

This might be because:

  • Benchmarks failed to run
  • No benchmark tests found
  • Dependencies missing

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90%. Comparing base (361c0cc) to head (97e41f2).
⚠️ Report is 29 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3125   +/-   ##
=====================================
- Coverage     90%     90%   -0%     
=====================================
  Files        445     441    -4     
  Lines      38792   38743   -49     
=====================================
- Hits       34715   34663   -52     
- Misses      4077    4080    +3     

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

@liquidsec liquidsec self-assigned this May 25, 2026
@liquidsec
liquidsec requested a review from ausmaster May 25, 2026 15:16
@liquidsec
liquidsec merged commit 61e3aaf into dev May 30, 2026
20 checks passed
@liquidsec liquidsec mentioned this pull request Jun 9, 2026
@ausmaster
ausmaster deleted the leakix-parse-guard branch June 11, 2026 01:27
@ausmaster ausmaster added this to the BBOT 3.0 - blazed_elijah milestone Jun 26, 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