HIGH: Snapshot restore executes stored environment variables as shell commands #29
Labels
No labels
blocked:gate-plan
blocked:gate-research
blocked:lint-failed
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:no-procedure
blocked:verify-failed
bug
chore
feature-request
in-progress
needs-research
ops-task
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/devforge#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
When restoring a snapshot, the stored
env_vars(captured viaenv | sort) are written to.bashrcby executing shell commands inside the container. If the environment variables contain malicious content, they get executed.Location
services/api/app/routes/snapshots.py:200-214Current Implementation
Note:
env | sortoutput from the original container contains all environment variables, including any that were set with special characters. While the code attempts to escape single quotes, the value is embedded in abash -lccommand string, which can still be exploited.Risk
exec_runwith root privileges inside the new containerProposed Fix
Priority: High
Type: Security
This is a security/design issue that needs human review before action.
Already fixed in commit
7d5ca55. Uses Docker API env mechanism instead of shell injection into .bashrc. JSON format for new snapshots with safe legacy fallback.Fixed in commit. Closing.