Skip to content

Create CommandInjection-Copy.java - #4

Open
nirw wants to merge 1 commit into
masterfrom
test-pull-requests
Open

Create CommandInjection-Copy.java#4
nirw wants to merge 1 commit into
masterfrom
test-pull-requests

Conversation

@nirw

@nirw nirw commented Jul 27, 2023

Copy link
Copy Markdown

No description provided.

}

public void badWithTaintSink() throws Exception {
taintSink("safe", req.getHeader("x"));

Check failure

Code scanning / Checkmarx - SAST

Command_Injection

The application's taintSink method calls an OS (shell) command with exec, at line 89 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, getHeader, which is retrieved by the application in the badWithTaintSink method, at line 85 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: 493043328 The application's sink method calls an OS (shell) command with exec, at line 16 of findsecbugs-samples-java\src\test\java\testcode\command\MoreMethods.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, getHeader, which is retrieved by the application in the call method, at line 259 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: -359728912 The application's sink2 method calls an OS (shell) command with exec, at line 21 of findsecbugs-samples-java\src\test\java\testcode\command\MoreMethods.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, getHeader, which is retrieved by the application in the callInterface method, at line 268 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: 686403988 The application's sink2 method calls an OS (shell) command with exec, at line 21 of findsecbugs-samples-java\src\test\java\testcode\command\MoreMethods.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, getHeader, which is retrieved by the application in the callInterface method, at line 269 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: 376341247 The application's taintSink2 method calls an OS (shell) command with exec, at line 101 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, ""y"", which is retrieved by the application in the badWithDoubleTaintSink method, at line 93 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: 1976974275 The application's badTransfer method calls an OS (shell) command with exec, at line 116 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command via user input, ""zzz"", which is retrieved by the application in the badTransfer method, at line 115 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java.Similarity ID: -605605059
streamFileInput = new FileInputStream(file);
readerInputStream = new InputStreamReader(streamFileInput, "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
return param + readerBuffered.readLine();

Check warning

Code scanning / Checkmarx - SAST

Stored_Command_Injection

The application's badInterMethod method calls an OS (shell) command with exec, at line 77 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 229 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the taintSource method.Similarity ID: 1683424008 The application's badWithException method calls an OS (shell) command with exec, at line 73 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 70 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the badWithException method.Similarity ID: -922178470 The application's testListIterator method calls an OS (shell) command with exec, at line 161 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 229 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the taintSource method.Similarity ID: -2048026020 The application's stringArrays method calls an OS (shell) command with exec, at line 134 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 229 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the taintSource method.Similarity ID: -1019083107 The application's comboSink method calls an OS (shell) command with exec, at line 111 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 229 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the taintSource method.Similarity ID: 562506524 The application's lists method calls an OS (shell) command with exec, at line 140 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, using an untrusted string with the command to execute.  This could allow an attacker to inject an arbitrary command, and enable a Command Injection attack.The attacker may be able to inject the executed command into the database, which is then retrieved by the application with readLine, at line 229 of findsecbugs-samples-java\src\test\java\testcode\command\CommandInjection-Copy.java, in the taintSource method.Similarity ID: -1336727186
@nirw

nirw commented Jul 27, 2023

Copy link
Copy Markdown
Author

Logo
Checkmarx One – Scan Summary & Details82795905-7008-4881-93d8-ec8f8b9ece2f

New Issues

Severity Issue Source File / Package Checkmarx Insight
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 115 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 93 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 269 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 268 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 259 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 85 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/MoreMethods.java: 8 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 70 Attack Vector
MEDIUM Stored_Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
LOW Command_Argument_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 16 Attack Vector
LOW Command_Argument_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 16 Attack Vector
LOW Command_Argument_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 16 Attack Vector
LOW Command_Argument_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 85 Attack Vector
LOW Hardcoded_AWS_Credentials /findsecbugs-samples-java/src/test/java/testcode/AwsQueryInjection.java: 18 Attack Vector
LOW Hardcoded_AWS_Credentials /findsecbugs-samples-java/src/test/java/testcode/AwsQueryInjection.java: 18 Attack Vector
LOW Improper_Resource_Access_Authorization /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
LOW Improper_Resource_Access_Authorization /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 70 Attack Vector
LOW Incorrect_Permission_Assignment_For_Critical_Resources /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 222 Attack Vector
LOW Incorrect_Permission_Assignment_For_Critical_Resources /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 62 Attack Vector
LOW Portability_Flaw_Locale_Dependent_Comparison /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 249 Attack Vector
LOW Portability_Flaw_Locale_Dependent_Comparison /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 249 Attack Vector
LOW Portability_Flaw_Locale_Dependent_Comparison /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 249 Attack Vector
LOW Portability_Flaw_Locale_Dependent_Comparison /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 251 Attack Vector
LOW Stored_Command_Argument_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection-Copy.java: 229 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 102 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 93 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 84 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 33 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 24 Attack Vector
LOW Use_of_Hardcoded_Password /findsecbugs-samples-kotlin/src/test/kotlin/com/h3xstream/findsecbugs/password/HardcodedPassword.kt: 15 Attack Vector

Fixed Issues

Severity Issue Source File / Package Checkmarx Insight
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH Command_Injection /findsecbugs-samples-java/src/test/java/testcode/command/CommandInjection.java: 16 Attack Vector
HIGH LDAP_Injection /findsecbugs-samples-java/src/test/java/testcode/ldap/JndiLdapSpecial.java: 8 Attack Vector
HIGH Reflected_XSS_All_Clients /findsecbugs-samples-java/src/test/java/testcode/cookie/UrlRewriting.java: 13 Attack Vector
HIGH Reflected_XSS_All_Clients /findsecbugs-samples-java/src/test/java/testcode/xss/servlets/XssServlet3.java: 18 Attack Vector
HIGH SQL_Injection /findsecbugs-samples-java/src/test/java/testcode/taint/JaxRsAnnotatedController.java: 23 Attack Vector
HIGH XPath_Injection /findsecbugs-samples-java/src/test/java/testcode/xpath/XPathJavax.java: 10 Attack Vector
HIGH XPath_Injection /findsecbugs-samples-java/src/test/java/testcode/xpath/XPathJavax.java: 10 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Absolute_Path_Traversal /findsecbugs-samples-java/src/test/java/testcode/pathtraversal/PathTraversal.java: 15 Attack Vector
MEDIUM Unchecked_Input_for_Loop_Condition /findsecbugs-samples-java/src/test/java/testcode/xpath/XPathApacheXPathApi.java: 12 Attack Vector
LOW Log_Forging /findsecbugs-samples-java/src/test/java/testcode/struts1/StrutsV1Action.java: 22 Attack Vector

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.

2 participants