Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sanitize domain input to prevent command injection #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alpernae
Copy link

@alpernae alpernae commented Nov 9, 2024

This PR addresses a command injection vulnerability in adddomain.sh by sanitizing the domain input. The updated code checks that domain contains only valid domain characters, which mitigates the risk of command injection.

- Added input validation for the domain parameter to allow only alphanumeric characters, dots, and dashes.
- This mitigates a command injection vulnerability on line 9 where unsanitized user input could be injected into the sed command.
- The fix improves security for local script execution in multi-user environments or when the script is run with elevated privileges.
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