Repository navigation
Conversation
The input guard in check_query reads "if not request.get("ip-src") and
request.get("ip-dst")", which is inverted. A hover or expansion on a plain
ip-dst attribute is rejected with "Unsupported attributes type." even though
ip-dst is a declared input, while a request carrying neither ip-src nor ip-dst
passes the guard and ends up with value None, so the module queries
backscatter.io with query=None and the analyst gets an opaque API error
instead of a clear unsupported-attribute message. The guard now requires both
values to be absent before bailing out, and the value is picked from whichever
of the two is actually populated rather than from mere key presence.
Verified with flake8 on the changed file and the full test suite against a
local modules server: 161 passed, 4 skipped, 5 subtests passed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF — Backscatter.io enrichment now works for
ip-dst-only requests and rejects empty ones.check_queryinbackscatter_io.pybails out onnot request.get("ip-src") and request.get("ip-dst"), rejecting exactly the validip-dst-only case, while a request with neither attribute falls through and queries the API withvalue=None; the followingif "ip-src" in requestalso lets an emptyip-srckey shadow a populatedip-dst.request.get("ip-src").ip-dstattribute get results instead of "Unsupported attributes type", and empty requests fail cleanly.The input guard in
check_querywas inverted, so it silently mishandled valid enrichment requests:The condition only bails out when
ip-srcis absent andip-dstis present — i.e. it rejects the exact case it should support (a validip-dst-only request), while a request with neither attribute falls through the guard entirely and reachesprofile["value"] = request.get("ip-dst"), which resolves toNone. Separately,if "ip-src" in requesttreats an empty/falsyip-srckey as present, shadowing a perfectly goodip-dstvalue.Impact: An analyst enriching an
ip-dstattribute with the Backscatter.io module getsUnsupported attributes typeeven thoughip-dstis a supported attribute type for this module, and a malformed request (no IP at all) proceeds to query the API withvalue=Noneinstead of failing cleanly.Fix: Negate the second half of the guard (
and not request.get("ip-dst")) so it only rejects requests where both are absent, and switch the value-selection check torequest.get("ip-src")so an emptyip-srcno longer masks a populatedip-dst. Purely a bug fix — no behaviour change beyond makingip-dst-only requests work as intended.Found during a review of the repository; other findings are being submitted as separate PRs.
Verification
flake8on the changed file: clean, no output.161 passed, 4 skipped, 5 subtests passed in 105.43s (0:01:45).🤖 Generated with Claude Code