Repository navigation
Conversation
…ccess The handler calls query_greynoise_ip_hover, query_greynoise_ip_expansion and query_greynoise_vulnerability as bare statements, so the misperrors dict each of them returns on failure is discarded and the handler unconditionally returns get_result(). When the API key is invalid or unauthorised, the GreyNoise service is down, or the request raises, the analyst gets a successful-looking enrichment with no attributes rather than the error message the module actually produced. The return values are now captured and returned when the query reports an error, matching the pattern already used inside the parser methods. 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 —
greynoiseswallows query errors and returns an empty result that looks like success.handler()inmisp_modules/modules/expansion/greynoise.pyinvokesquery_greynoise_ip_hover,query_greynoise_ip_expansionandquery_greynoise_vulnerabilityas bare statements and then unconditionally returnsget_result(), discarding themisperrorsdict those methods return on failure.None.In
misp_modules/modules/expansion/greynoise.py,handler()called the query functions as bare statements and discarded their return value:Each of these query methods returns a
misperrorsdict when the query fails (bad API key, GreyNoise outage, unsupported vulnerability lookup on a Community key, etc.), but that return value was never captured, andhandler()unconditionally returnedget_result()afterward.Impact: when GreyNoise enrichment fails for any reason, the analyst sees a successful-looking response with an empty enrichment instead of an error, silently masking outages or credential problems and giving a false sense that "GreyNoise checked this IP and found nothing."
Fix: capture each query call's return value and
returnit immediately when it is notNone, matching the error-return pattern already used inside the parser methods. Success paths are unaffected, since those methods fall off the end (implicitNone) when the query succeeds.No behaviour change beyond correctly surfacing pre-existing error paths that were previously swallowed.
Verification
flake8on the changed file: clean, no output.Found during a review of the repository; other findings are being submitted as separate PRs.
🤖 Generated with Claude Code