Security: Prevent shell injection in cron tasks and config files#2924
Draft
Security: Prevent shell injection in cron tasks and config files#2924
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tion Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix memory issue with .fullgc usage
Security: Prevent shell injection in cron tasks and config files
Feb 8, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cron task fields (
task_before,task_after,command) and config file writes lacked input validation and proper shell escaping. Reported incident: malicious code downloaded.fullgcbinary from external domain, executed in background consuming 100% memory, and persisted by re-injecting itself.Example of previously unvalidated malicious input:
Changes
Input Validation (
back/validation/schedule.ts)Added
validateShellSecurity()to block:$(...), backtickscurl,wget,fetchhttps?:///\.filebase64,eval(curl|wget).*>/dev/null.*&,/tmp/.*&&.*(chmod|\.\/)Shell Escaping (
back/services/cron.ts)Replaced weak escaping with
escapeShellArg():Config File Security (
back/api/config.ts)Added content validation for config writes to detect:
(curl|wget).*\|.*bash(curl|wget).*&&.*chmod(curl|wget).*\/\.\w+Documentation (
SECURITY_ENHANCEMENTS.md)Remediation steps for affected users, detection patterns, and security best practices.
Security Impact
Prevents:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.