skills/312362115/claude/preview-md/Gen Agent Trust Hub

preview-md

Fail

Audited by Gen Agent Trust Hub on May 16, 2026

Risk Level: HIGHDATA_EXFILTRATIONREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [DATA_EXFILTRATION]: The Node.js server in 'scripts/preview-md.mjs' exposes an '/api/file' endpoint that reads and serves arbitrary files from the local filesystem. It uses a user-provided 'path' parameter without any validation or directory restriction, allowing access to sensitive local data.\n
  • Evidence: 'const filePath = decodeURIComponent(url.searchParams.get('path') || ''); ... const content = readFileSync(filePath);' in scripts/preview-md.mjs.\n- [COMMAND_EXECUTION]: The shell script 'scripts/md-notify.sh' is vulnerable to command injection. It uses an unquoted heredoc ('cat <<EOF') which allows the shell to evaluate command substitutions (e.g., $(command)) present in the 'file_path' variable when generating the hook output.\n
  • Evidence: The interpolation of '"$file_path"' inside a 'cat <<EOF' block in scripts/md-notify.sh.\n- [REMOTE_CODE_EXECUTION]: The markdown rendering implementation is vulnerable to Cross-Site Scripting (XSS). It renders markdown using 'innerHTML' with the 'marked' library without applying any sanitization, which could allow a malicious markdown file to execute arbitrary JavaScript in the user's browser context.\n
  • Evidence: 'document.getElementById('content').innerHTML = marked.parse(md, { renderer });' in the buildHTML function of scripts/preview-md.mjs.\n- [EXTERNAL_DOWNLOADS]: The previewer loads external JavaScript and CSS libraries from public CDNs (cdnjs.cloudflare.com, cdn.jsdelivr.net) at runtime. These are well-known technology services used for markdown rendering and syntax highlighting.\n
  • Evidence: Links to highlight.js, marked, and KaTeX in the buildHTML function.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
May 16, 2026, 04:36 AM
Security Audit — agent-trust-hub — preview-md