when-documenting-code-use-doc-generator
Audited by Socket on May 13, 2026
3 alerts found:
Anomalyx3This script is primarily a documentation generator that writes api.yml and API.md templates. It contains no direct malicious behaviors in the Bash logic (no shell backdoors, credential theft, or persistence). The main security concern is repeated execution of an unpinned external dependency via npx claude-flow@alpha, including a 'memory store' action that transmits generated file-path metadata and route-count metrics to an external backend (network behavior depends on that package). Pin/verify the external tooling and review its network/telemetry behavior before using in sensitive pipelines.
The core functionality is benign (templated README generation), but the script introduces a significant supply-chain/telemetry risk by executing an external npm package (claude-flow@alpha) multiple times during generation and performing a “memory store” action containing the local README path and project type. Additionally, it writes unsanitized project metadata into README.md, which can cause downstream content-injection/phishing risks depending on how the README is rendered. No direct destructive malware behavior is evident in this fragment; the primary risk is the unexpected runtime execution of external code plus suppressed errors that reduce auditability.
No clear direct malware behavior is evident within the shown script logic (no credential theft, no destructive actions, no explicit exfiltration endpoints). However, the script repeatedly executes an external npm dependency via npx (claude-flow@alpha) and triggers multiple hook stages while processing repository file paths and computed coverage metrics. Because hook implementations can arbitrarily read/modify files and exfiltrate data, this is a meaningful supply-chain execution and potential telemetry risk. Treat the external claude-flow dependency and its hooks/memory store behavior as the primary security concern: pin/lock versions, audit the package, and run in a restricted environment.