Repository navigation
Conversation
|
QHelp previews: cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelpUncontrolled data used in OS commandThe code passes user input as part of a call to RecommendationUse a library routine to escape characters in the user-supplied string before passing it to a command shell. ExampleThe following example runs an external command in two ways. The first way uses int main(int argc, char** argv) {
char *userName = argv[2];
{
// BAD: a string from the user is injected directly into
// a command line.
char command1[1000] = {0};
sprintf(command1, "userinfo -v \"%s\"", userName);
system(command1);
}
{
// GOOD: the user string is encoded by a library routine.
char userNameQuoted[1000] = {0};
encodeShellString(userNameQuoted, 1000, userName);
char command2[1000] = {0};
sprintf(command2, "userinfo -v %s", userNameQuoted);
system(command2);
}
}References
cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelpUncontrolled data used in
|
There was a problem hiding this comment.
🔵 Needs a closer look
The replacements are consistent, but the new URL’s reachability could not be independently confirmed and needs human verification.
No open issues 🎉
What changed in this PR
Updates a repeated OWASP reference in CodeQL query-help documentation across eight languages.
Changes:
- Replaces the legacy Command Injection URL in 23
.qhelpfiles withhttps://community.owasp.org/attacks/Command_Injection. - Preserves link text, document structure, and query behavior.
| File | Description |
|---|---|
| swift/ql/src/queries/Security/CWE-078/CommandInjection.qhelp | Updates the command-injection reference. |
| ruby/ql/src/queries/security/cwe-078/UnsafeShellCommandConstruction.qhelp | Updates the unsafe-shell-command reference. |
| ruby/ql/src/queries/security/cwe-078/KernelOpen.inc.qhelp | Updates the shared Kernel.open reference. |
| ruby/ql/src/queries/security/cwe-078/CommandInjection.qhelp | Updates the command-injection reference. |
| python/ql/src/Security/CWE-078/UnsafeShellCommandConstruction.qhelp | Updates the unsafe-shell-command reference. |
| python/ql/src/Security/CWE-078/CommandInjection.qhelp | Updates the command-injection reference. |
| javascript/ql/src/Security/CWE-078/UselessUseOfCat.qhelp | Updates the shell-command security reference. |
| javascript/ql/src/Security/CWE-078/UnsafeShellCommandConstruction.qhelp | Updates the unsafe-shell-command reference. |
| javascript/ql/src/Security/CWE-078/ShellCommandInjectionFromEnvironment.qhelp | Updates the environment-based injection reference. |
| javascript/ql/src/Security/CWE-078/SecondOrderCommandInjection.qhelp | Updates the second-order injection reference. |
| javascript/ql/src/Security/CWE-078/IndirectCommandInjection.qhelp | Updates the indirect injection reference. |
| javascript/ql/src/Security/CWE-078/CommandInjection.inc.qhelp | Updates the shared command-injection reference. |
| java/ql/src/Security/CWE/CWE-078/ExecUnescaped.qhelp | Updates the unescaped-execution reference. |
| java/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp | Updates the tainted-execution reference. |
| java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.qhelp | Updates the experimental execution reference. |
| java/ql/src/experimental/Security/CWE/CWE-078/CommandInjectionRuntimeExecLocal.qhelp | Updates the local Runtime.exec reference. |
| java/ql/src/experimental/Security/CWE/CWE-078/CommandInjectionRuntimeExec.qhelp | Updates the Runtime.exec injection reference. |
| go/ql/src/Security/CWE-089/StringBreak.qhelp | Updates the OWASP injection reference. |
| go/ql/src/Security/CWE-078/StoredCommand.qhelp | Updates the stored-command injection reference. |
| go/ql/src/Security/CWE-078/CommandInjection.qhelp | Updates the command-injection reference. |
| csharp/ql/src/Security Features/CWE-078/CommandInjection.qhelp | Updates the command-injection reference. |
| cpp/ql/src/Security/CWE/CWE-078/ExecTainted.qhelp | Updates the tainted-execution reference. |
| cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.qhelp | Updates the wordexp injection reference. |
Review effort: Max
Replace a dead link that's repeated in quite a number of
.qhelpfiles.