Skip to content

fix(security): address audit findings in CLI and scripts#201

Open
freQuensy23-coder wants to merge 1 commit intonextlevelbuilder:mainfrom
freQuensy23-coder:fix/security-audit-findings
Open

fix(security): address audit findings in CLI and scripts#201
freQuensy23-coder wants to merge 1 commit intonextlevelbuilder:mainfrom
freQuensy23-coder:fix/security-audit-findings

Conversation

@freQuensy23-coder
Copy link
Copy Markdown

@freQuensy23-coder freQuensy23-coder commented Mar 21, 2026

Summary

  • Command injection: Replace exec()/execSync() with execFile()/execFileSync() in extract.ts and sync-brand-to-tokens.cjs to prevent shell metacharacter injection
  • Zip Slip protection: Validate all extracted file paths stay within destination directory in extract.ts
  • XSS prevention: Add html.escape() to all user-provided data in render-html.py and generate-slide.py; add URL sanitization blocking javascript: URIs in CTA slide hrefs
  • Download hardening: Add 50MB size limit and semver validation on tag_name in github.ts
  • Housekeeping: Remove committed .coverage SQLite file, add .coverage to .gitignore

Test plan

  • Run npx tsc --noEmit to verify CLI compiles after extract.ts changes
  • Run python3 render-html.py with a brand name containing <script> to confirm it's escaped
  • Run python3 generate-slide.py --demo to verify slides still render correctly
  • Run node sync-brand-to-tokens.cjs to verify token sync still works (exits cleanly when no brand-guidelines.md present)

🤖 Generated with Claude Code

- Replace exec()/execSync() with execFile()/execFileSync() in extract.ts
  and sync-brand-to-tokens.cjs to prevent command injection
- Add Zip Slip path traversal protection after ZIP extraction in extract.ts
- Add html.escape() to all user-provided data in render-html.py and
  generate-slide.py to prevent XSS in generated HTML
- Add URL sanitization for href attributes in generate-slide.py CTA slides
- Add download size limit (50MB) and tag_name semver validation in github.ts
- Add .coverage to .gitignore and remove committed .coverage SQLite file

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mrgoonie
Copy link
Copy Markdown
Contributor

@claude review

@claude
Copy link
Copy Markdown

claude bot commented Mar 24, 2026

Claude Code is working…

I'll analyze this and get back to you.

View job run

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.

2 participants