Repository navigation
Conversation
handler() iterates the DomainTools service functions (parsed_whois,
domain_profile, reverse_whois, host_domains, reverse_ip_whois) and
discards each call's return value. Every one of these functions
signals a failed API call by returning the module-level misperrors
dict, but since handler() never inspects that return, a failed
lookup falls straight through to `return {"results": values.dump()}`
with whatever partial values were collected before the failure -
an analyst sees an empty or partial success instead of the actual
DomainTools error (bad credentials, rate limit, API outage).
Capture each service call's return value and, when it is the
misperrors object, return it immediately instead of continuing the
loop.
Verified with flake8 (clean) and the full pytest suite against a
freshly started modules server on port 6755: 161 passed, 4 skipped,
5 subtests passed, matching the documented baseline.
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 —
domaintoolsdiscards service-call return values, so failed API lookups look like empty results.handler()loop inmisp_modules/modules/expansion/domaintools.pycalls each requested service function but discards the return value, so when a service signals failure by returning themisperrorsdict the error is thrown away and the loop continues.misperrorsimmediately when a call has failed.domaintools.py'shandler()calls each requested service function in a loop but discards the return value:Every service function (
parsed_whois,domain_profile,reverse_whois,host_domains,reverse_ip_whois) signals an API failure byreturning the module-levelmisperrorsdict; on success it returns thevaluesaccumulator instead. Because the loop never looks at the return value, a failed call's error is thrown away and the loop simply moves on.Impact on an analyst: if a DomainTools API call fails (bad credentials, quota exceeded, upstream error), the module does not report the failure. Instead it returns
{"results": values.dump()}with whatever partial data was collected before the failure — which can be empty. This looks to the analyst like "DomainTools has no data for this indicator" rather than "the lookup failed," so a real API problem is silently mistaken for a negative enrichment result.Fix: capture each service call's return value and, if it
is misperrors(an identity check, since the success path returns the separatevaluesobject), returnmisperrorsimmediately instead of continuing the loop.This does not change any documented contract — returning
misperrorson failure is exactly what the finding calls for and what the other error paths in this module already do; it simply stops that signal from being dropped.Verification
flake8on the changed file: clean (exit 0)161 passed, 4 skipped, 5 subtests passed in 43.44sFound during a review of the repository; other findings are being submitted as separate PRs.
🤖 Generated with Claude Code