Skip to content

feat(workflow): add workflow auditor + scan-workflow CLI (v0.6.0)#4

Merged
neuregex merged 1 commit into
mainfrom
feat/workflow-auditor
May 29, 2026
Merged

feat(workflow): add workflow auditor + scan-workflow CLI (v0.6.0)#4
neuregex merged 1 commit into
mainfrom
feat/workflow-auditor

Conversation

@neuregex

Copy link
Copy Markdown
Owner

Adds a parallel scanning surface for ComfyUI workflow files (JSON exports
and PNG images with workflow metadata embedded in tEXt/zTXt/iTXt chunks).
Workflows ship more freely than custom_nodes (Civitai, Reddit, Discord)
and carry their own attack surface: malicious widget values, embedded
Python in ExecutePython-style nodes, exfiltration URLs, references to
compromised custom_nodes.

New module src/nodesafe/workflow/ with:

  • Workflow + WorkflowNode dataclasses normalizing UI form and prompt form
  • Parser for JSON and PNG (stdlib struct + zlib, no Pillow dep)
  • WL1: URL membership check over widget-value URLs (reuses malicious_urls.txt)
  • WL2: Aho-Corasick over widget-value text (reuses patterns.json)
  • WorkflowScanner orchestrator emitting the same Report shape as code scanning

CLI gains 'nodesafe scan-workflow TARGET' with --format, --fail-on, --config.

  • 19 new tests (parser, extractors, analyzers, CLI), 106/106 total passing
  • ruff, ruff format, pyright all clean
  • no new runtime deps
  • bumps to v0.6.0

Adds a parallel scanning surface for ComfyUI workflow files (JSON exports
and PNG images with workflow metadata embedded in tEXt/zTXt/iTXt chunks).
Workflows ship more freely than custom_nodes (Civitai, Reddit, Discord)
and carry their own attack surface: malicious widget values, embedded
Python in ExecutePython-style nodes, exfiltration URLs, references to
compromised custom_nodes.

New module src/nodesafe/workflow/ with:
- Workflow + WorkflowNode dataclasses normalizing UI form and prompt form
- Parser for JSON and PNG (stdlib struct + zlib, no Pillow dep)
- WL1: URL membership check over widget-value URLs (reuses malicious_urls.txt)
- WL2: Aho-Corasick over widget-value text (reuses patterns.json)
- WorkflowScanner orchestrator emitting the same Report shape as code scanning

CLI gains 'nodesafe scan-workflow TARGET' with --format, --fail-on, --config.

- 19 new tests (parser, extractors, analyzers, CLI), 106/106 total passing
- ruff, ruff format, pyright all clean
- no new runtime deps
- bumps to v0.6.0
@neuregex
neuregex merged commit 5b431af into main May 29, 2026
12 checks passed
@neuregex
neuregex deleted the feat/workflow-auditor branch May 29, 2026 08:33
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