Repository navigation
Conversation
The module reads the optional shareable, do_not_reanalyze and do_not_include_vmrayjobids settings straight out of the request config and hands them to strtobool. When an analyst configures only apikey and url and leaves those flags blank, MISP sends them as None, and strtobool(None) raises AttributeError while only ValueError is caught, so the submission crashes with an unhandled exception instead of running with the documented defaults. Falling back to "false" when the value is absent or empty keeps the flag semantics unchanged: samples are not shared, samples are reanalyzed and VMRay job IDs are included. 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 —
vmray_submitcrashes on every submission when an optional flag is left unset in its config.expansion/vmray_submit.pyreads the optionalshareable,do_not_reanalyzeanddo_not_include_vmrayjobidskeys with a bare.get()and passes the result tostrtobool, which raisesAttributeErroronNone; onlyValueErroris caught, so the exception escapeshandler()."false"withor "false".vmray_submitbut left one of those flags unset now takes the documented default (not shared, reanalyze, include job IDs) instead of crashing; configs that already set the keys are unchanged.The optional VMRay settings are read straight from config and handed to
strtoboolwith no default:If any of these three optional config keys is left unset,
.get()returnsNone, andstrtobool(None)raisesAttributeError(it calls.lower()on its argument internally). OnlyValueErroris caught, so theAttributeErrorpropagates out ofhandler()uncaught.Impact: any MISP instance that has configured
vmray_submitbut left one or more ofshareable,do_not_reanalyze, ordo_not_include_vmrayjobidsunset will have the module crash on every submission attempt instead of falling back to its documented default behaviour (not shared, reanalyze, include job IDs) — a working-looking module that is actually unusable until an analyst notices and sets every optional flag explicitly.Fix: each of the three reads now falls back to the string
"false"withor "false", which covers both a missing key and an explicitNone/empty value, so an unset flag takes its documented default instead of crashingstrtobool.No behaviour change for instances that already set these keys; instances that left them unset now get the documented default instead of a crash.
Verification
flake8onmisp_modules/modules/expansion/vmray_submit.py: clean, no output.Found during a review of the repository; other findings are being submitted as separate PRs.
🤖 Generated with Claude Code