Fix code scanning alert no. 1: Shell command built from environment values #11
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: ABOCN/TelegramBot#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "autofix/alert-1-ce74013bf2"
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?
Fixes https://github.com/lucmsilva651/lynx/security/code-scanning/1
To fix the problem, we should avoid constructing the shell command as a single string. Instead, we should use the
execFile
function from thechild_process
module, which allows us to pass the command and its arguments separately. This approach prevents the shell from interpreting special characters in the arguments.exec
function withexecFile
.execFile
.Suggested fixes powered by Copilot Autofix. Review carefully before merging.