Skip to content

fix: Command injection in VPS setup script#47

Open
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/b8403982/command-injection-in-vps-setup
Open

fix: Command injection in VPS setup script#47
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/b8403982/command-injection-in-vps-setup

Conversation

@mrwind-up-bird
Copy link
Copy Markdown
Collaborator

AutoFix: Command injection in VPS setup script

Category: security
Severity: high

Issue

The setup script uses SUDO_USER environment variable directly in shell commands without validation. An attacker who can control this variable could inject commands through the usermod operation.

Fix

Added input validation for the SUDO_USER environment variable using a regex pattern that only allows alphanumeric characters, dashes, and underscores. This prevents command injection by ensuring the variable cannot contain shell metacharacters or command separators before it's used in the usermod command.


Generated by nyxCore AutoFix

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