Skip to content

leakix: guard parse_results against non-list JSON#3125

Open
liquidsec wants to merge 1 commit into
devfrom
leakix-parse-guard
Open

leakix: guard parse_results against non-list JSON#3125
liquidsec wants to merge 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
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90%. Comparing base (361c0cc) to head (97e41f2).
⚠️ Report is 20 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.

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.

1 participant