Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/coverity-ss-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ jobs:
coverity_passphrase: ${{ secrets.COVERITY_PASSPHRASE }}
coverity_policy_view: ${{ github.event_name != 'pull_request' && 'Outstanding Issues' || '' }}
coverity_prComment_enabled: true
coverity_build_command: mvn -B -DskipTests package
coverity_clean_command: mvn -B clean
#coverity_build_command: mvn -B -DskipTests package
#coverity_clean_command: mvn -B clean
coverity_build_command: sh -c "cd subdir && mvn -B -DskipTests package"
coverity_clean_command: sh -c "cd subdir && mvn -B clean"
coverity_args: -o analyze.checkers.checker-config.OVERRUN.options.report_unprotected_indexing=true
# coverity_local: true
github_token: ${{ secrets.GITHUB_TOKEN }}
include_diagnostics: true
project_directory: subdir
#project_directory: subdir
13 changes: 13 additions & 0 deletions src/main/java/CommandInjection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// https://documentation.blackduck.com/bundle/coverity-docs/page/checker-ref/checkers/NO/os_cmd_injection.html

import java.io.*;
import javax.servlet.http.HttpServletRequest;

public class CommandInjection {
public static Process runCmd(HttpServletRequest request) throws IOException {
String command = request.getParameter("command");
ProcessBuilder builder = new ProcessBuilder("sh", command);
Process process = builder.start();
return(process);
}
}
Loading