Skip to content

Fix injection vulnerabilities and add protection tests#8

Merged
whw merged 3 commits intomainfrom
fix/injection-protection
Feb 9, 2026
Merged

Fix injection vulnerabilities and add protection tests#8
whw merged 3 commits intomainfrom
fix/injection-protection

Conversation

@whw
Copy link
Collaborator

@whw whw commented Feb 9, 2026

Summary

  1. Fix JS template literal injection - AI responses containing ${VAR} patterns were being evaluated as JavaScript. Now passes responses via process.env to treat them as plain strings.

  2. Add comprehensive injection protection tests:

    • test-shell-escaping - Verifies backticks, $(cmd), $VAR don't execute
    • test-comment-construction - Verifies ${VAR}, ${{ }} don't break JS
  3. Updated malicious skill fixture with all injection patterns:

    • JS: ${SECRETS}, ${process.exit(1)}
    • Shell: `id`, $(whoami), $HOME
    • GitHub Actions: ${{ secrets.TOKEN }}
    • JSON: quotes, backslashes
    • Pipes, redirects, HTML comments

Test plan

  • All injection protection tests pass
  • Malicious skill still detected (FAIL verdict)
  • Safe skill still approved (PASS/WARN verdict)
  • Re-run PR [Skill Submission] bar1 #6 after merge to verify comment posts correctly

whw added 3 commits February 8, 2026 18:20
Tests verify the workflow handles dangerous patterns without breaking:
- JS template literals: ${VAR}, ${process.exit(1)}
- Shell injection: $(cmd), `cmd`, $VAR
- GitHub Actions expressions: ${{ secrets.TOKEN }}
- JSON special chars: quotes, backslashes, newlines
- Other: pipes, redirects, HTML comments

Also updates malicious skill fixture to include all these patterns.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 9, 2026

Deploying everyskill with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad130cc
Status: ✅  Deploy successful!
Preview URL: https://fa5848bf.everyskill.pages.dev
Branch Preview URL: https://fix-injection-protection.everyskill.pages.dev

View logs

@whw whw merged commit d0e295a into main Feb 9, 2026
6 checks passed
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