Skip to content

[critical] fix: [assemblyline_query] remove world-readable debug dump of parsed events - #868

Open
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/059-assemblyline-debug-dump
Open

elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/059-assemblyline-debug-dump

Conversation

@elhoim

@elhoim elhoim commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

BLUF — assemblyline_query dumps every parsed event to a world-readable /tmp file on every query.

  • Problem — The finalize_results method of AssemblyLineParser in misp_modules/modules/expansion/assemblyline_query.py writes the full parsed MISP event to a fixed /tmp/assemblyline_query_debug.json path on every successful query, with no config flag, no cleanup and default umask permissions.
  • Fix — Deletes those five lines outright; nothing downstream reads the file.
  • Effect — AssemblyLine classification data and the indicators that prompted each query are no longer exposed to other local users or containers sharing /tmp, and the module's returned attributes, objects and tags are unchanged.

The finalize_results method in AssemblyLineParser unconditionally wrote the full parsed MISP event to a fixed, world-readable path on every successful query:

event = json.loads(self.misp_event.to_json())
try:
    with open("/tmp/assemblyline_query_debug.json", "w", encoding="utf-8") as debug_file:
        json.dump(event, debug_file, indent=2)
except Exception:
    pass

This dump had no config flag to disable it, no cleanup afterward, and no restrictive file permissions — /tmp is world-readable on typical multi-user systems, and the file itself inherited the default umask (commonly 0644). The dumped content included the parsed MISP event's Attributes, Objects, and Tags, i.e. the AssemblyLine classification data being pulled into the event, plus whatever indicator data prompted the query.

Impact: any other local user or process on the MISP server (or any worker/container sharing /tmp) could read the AssemblyLine classification results and indicator data from recent enrichment queries, and each query silently overwrote the previous dump, leaking data with no opt-in, no audit trail, and no way for an analyst to disable it short of patching the module.

Fix: removed the debug dump entirely — nothing downstream reads this file, so deleting it is the minimal fix (the alternative, gating it behind an explicit debug flag writing to a 0600 file, was not needed since the dump was pure dead debug code with no consumer).

This is a pure deletion with no behavior change to the module's actual output (Attribute/Object/Tag results returned to MISP are unaffected).

Verification

  • flake8 misp_modules/modules/expansion/assemblyline_query.py — clean, no output.
  • Full module test suite: 161 passed, 4 skipped, 5 subtests passed in 31.27s.

Found during a review of the repository; other findings are being submitted as separate PRs.

🤖 Generated with Claude Code

…events

finalize_results wrote the full parsed MISP event, including AssemblyLine
classification tags pulled from the submission, to /tmp/assemblyline_query_debug.json
on every successful query. That file has no permission restriction and is
never cleaned up, so any local user on the modules host can read enrichment
data and classification markings from a submission the module never intended
to expose outside of the returned results.

Verified with flake8 (clean) and the full pytest suite against a live
modules server on port 6759: 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
@elhoim elhoim changed the title fix: [assemblyline_query] remove world-readable debug dump of parsed events [critical] fix: [assemblyline_query] remove world-readable debug dump of parsed events Sep 3, 2026

This branch has not been deployed

No deployments
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