Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@anzz1
Copy link

@anzz1 anzz1 commented Sep 6, 2025

Previously only the space character (why?) and the backslash character were escaped, leaving commands vulnerable to shell injection.

The correct way is to only escape the single-quote, and then put the path variables '$@' '$#' in them in commands. Other characters need not be escaped, as they will not be treated as special within single-quoted strings.

This fixes multiple vulnerabilities.

Previously only the space character (why?) and the backslash character
were escaped, leaving commands vulnerable to shell injection.

The correct way is to only escape the single-quote, and then put the path variables '$@' '$#' in them in commands. Other characters need not be escaped, as they will not be treated as special within single-quoted strings.
@anzz1 anzz1 mentioned this pull request Sep 6, 2025
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