Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add Semgrep to workflows (#30610) #30611

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

spbolton
Copy link
Contributor

@spbolton spbolton commented Nov 8, 2024

Proposed Changes

  • enable semgrep in workflows in parallel with sonarqube
  • add ability to use github vars DISABLE_SONAR=true and DISABLE_SEMGREP=true on the repository to disable if issues without pushing code change
    setting vars.SEMGREP_NO_FAIL=true will run Semgrep unless it is disabled, but will not fail the workflow step

This PR fixes: #30610

@spbolton spbolton requested a review from a team as a code owner November 8, 2024 15:43
@spbolton spbolton linked an issue Nov 8, 2024 that may be closed by this pull request
@spbolton spbolton marked this pull request as draft November 8, 2024 18:08
@spbolton spbolton force-pushed the issue-30610-add-semgrep-to-workflows branch 2 times, most recently from 084de1d to e6f976a Compare November 8, 2024 18:43
@semgrep-code-dotcms-test
Copy link

Semgrep found 3 ssc-76fc8612-6086-65ec-f222-eb87f32205aa findings:

Risk: Affected versions of com.graphql-java:graphql-java are vulnerable to Allocation of Resources Without Limits or Throttling. The package does not properly consider ExecutableNormalizedFields (ENFs) as part of preventing denial of service via introspection queries.

Fix: Upgrade this library to at least version 19.11 at core/dotcms-integration/maven_dep_tree.txt:126.

Reference(s): GHSA-h9mq-f6q5-6c8m, CVE-2024-40094

Ignore this finding from ssc-76fc8612-6086-65ec-f222-eb87f32205aa.

Semgrep found 2 ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5 findings:

  • tools/dotcms-cli/api-data-model/maven_dep_tree.txt
  • tools/dotcms-cli/cli/maven_dep_tree.txt

Risk: Affected versions of io.quarkus:quarkus-core are vulnerable to Cleartext Storage Of Sensitive Information In An Environment Variable. The vulnerability lies within the quarkus-core component, concerning how Quarkus handles local environment variables; specifically, during the build phase of a Quarkus application, it captures and embeds the local environment variables under the Quarkus namespace into the application, potentially exposing test configurations set by developers or continuous integration (CI) systems, thus risking insecure behavior in production if not overridden.

Manual Review Advice: A vulnerability from this advisory is reachable if you are using configuration properties that are prefixed with quarkus.

Fix: Upgrade this library to at least version 3.8.4 at core/tools/dotcms-cli/api-data-model/maven_dep_tree.txt:11.

Reference(s): GHSA-f8h5-v2vg-46rr, CVE-2024-2700

Ignore this finding from ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5.

Semgrep found 1 ssc-2f60da75-9a82-4e28-a683-78548dcdb586 finding:

Risk: Affected versions of org.apache.tomcat.embed:tomcat-embed-core and org.apache.tomcat:tomcat are vulnerable to Improper Input Validation. The vulnerability in Apache Tomcat involves a Denial of Service due to improper input validation in HTTP/2 requests, where if the request surpasses configured header limits, the corresponding HTTP/2 stream remains unreset until after all headers have been processed.

Fix: Upgrade this library to at least version 9.0.86 at core/dotCMS/maven_dep_tree.txt:396.

Reference(s): GHSA-7w75-32cg-r6g2, CVE-2024-24549

Ignore this finding from ssc-2f60da75-9a82-4e28-a683-78548dcdb586.

Semgrep found 3 ssc-edad62ae-dae3-44f1-950a-94488a700a38 findings:

Risk: Affected versions of org.elasticsearch:elasticsearch are vulnerable to Uncontrolled Resource Consumption. An unauthenticated user can induce an Elasticsearch node to exit with an OutOfMemory error by sending a moderate number of malformed HTTP requests, due to the way Elasticsearch handles incoming requests on the HTTP layer.

Fix: Upgrade this library to at least version 7.17.13 at core/dotcms-integration/maven_dep_tree.txt:167.

Reference(s): GHSA-2cqf-6xv9-f22w, CVE-2023-31418

Ignore this finding from ssc-edad62ae-dae3-44f1-950a-94488a700a38.

Semgrep found 1 ssc-013caec7-58ca-cb2e-f8e3-0c6382ec5d6f finding:

Risk: Affected versions of org.apache.tomcat.embed:tomcat-embed-core and org.apache.tomcat:tomcat-coyote are vulnerable to Improper Handling of Exceptional Conditions / Uncontrolled Resource Consumption.

Fix: Upgrade this library to at least version 9.0.90 at core/dotCMS/maven_dep_tree.txt:396.

Reference(s): GHSA-wm9w-rjj3-j356, CVE-2024-34750

Ignore this finding from ssc-013caec7-58ca-cb2e-f8e3-0c6382ec5d6f.

@spbolton spbolton force-pushed the issue-30610-add-semgrep-to-workflows branch from 1c074e0 to 8315925 Compare November 11, 2024 13:22
@semgrep-code-dotcms-test
Copy link

Semgrep found 3 ssc-76fc8612-6086-65ec-f222-eb87f32205aa findings:

Risk: Affected versions of com.graphql-java:graphql-java are vulnerable to Allocation of Resources Without Limits or Throttling. The package does not properly consider ExecutableNormalizedFields (ENFs) as part of preventing denial of service via introspection queries.

Fix: Upgrade this library to at least version 19.11 at core/dotcms-integration/maven_dep_tree.txt:126.

Reference(s): GHSA-h9mq-f6q5-6c8m, CVE-2024-40094

Ignore this finding from ssc-76fc8612-6086-65ec-f222-eb87f32205aa.

Semgrep found 2 ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5 findings:

  • tools/dotcms-cli/api-data-model/maven_dep_tree.txt
  • tools/dotcms-cli/cli/maven_dep_tree.txt

Risk: Affected versions of io.quarkus:quarkus-core are vulnerable to Cleartext Storage Of Sensitive Information In An Environment Variable. The vulnerability lies within the quarkus-core component, concerning how Quarkus handles local environment variables; specifically, during the build phase of a Quarkus application, it captures and embeds the local environment variables under the Quarkus namespace into the application, potentially exposing test configurations set by developers or continuous integration (CI) systems, thus risking insecure behavior in production if not overridden.

Manual Review Advice: A vulnerability from this advisory is reachable if you are using configuration properties that are prefixed with quarkus.

Fix: Upgrade this library to at least version 3.8.4 at core/tools/dotcms-cli/api-data-model/maven_dep_tree.txt:11.

Reference(s): GHSA-f8h5-v2vg-46rr, CVE-2024-2700

Ignore this finding from ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5.

Semgrep found 3 ssc-edad62ae-dae3-44f1-950a-94488a700a38 findings:

Risk: Affected versions of org.elasticsearch:elasticsearch are vulnerable to Uncontrolled Resource Consumption. An unauthenticated user can induce an Elasticsearch node to exit with an OutOfMemory error by sending a moderate number of malformed HTTP requests, due to the way Elasticsearch handles incoming requests on the HTTP layer.

Fix: Upgrade this library to at least version 7.17.13 at core/dotcms-integration/maven_dep_tree.txt:167.

Reference(s): GHSA-2cqf-6xv9-f22w, CVE-2023-31418

Ignore this finding from ssc-edad62ae-dae3-44f1-950a-94488a700a38.

@spbolton spbolton force-pushed the issue-30610-add-semgrep-to-workflows branch from 8315925 to ae3fc78 Compare November 11, 2024 13:41
@semgrep-code-dotcms-test
Copy link

Semgrep found 3 ssc-76fc8612-6086-65ec-f222-eb87f32205aa findings:

Risk: Affected versions of com.graphql-java:graphql-java are vulnerable to Allocation of Resources Without Limits or Throttling. The package does not properly consider ExecutableNormalizedFields (ENFs) as part of preventing denial of service via introspection queries.

Fix: Upgrade this library to at least version 19.11 at core/dotcms-integration/maven_dep_tree.txt:126.

Reference(s): GHSA-h9mq-f6q5-6c8m, CVE-2024-40094

Ignore this finding from ssc-76fc8612-6086-65ec-f222-eb87f32205aa.

Semgrep found 2 ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5 findings:

  • tools/dotcms-cli/api-data-model/maven_dep_tree.txt
  • tools/dotcms-cli/cli/maven_dep_tree.txt

Risk: Affected versions of io.quarkus:quarkus-core are vulnerable to Cleartext Storage Of Sensitive Information In An Environment Variable. The vulnerability lies within the quarkus-core component, concerning how Quarkus handles local environment variables; specifically, during the build phase of a Quarkus application, it captures and embeds the local environment variables under the Quarkus namespace into the application, potentially exposing test configurations set by developers or continuous integration (CI) systems, thus risking insecure behavior in production if not overridden.

Manual Review Advice: A vulnerability from this advisory is reachable if you are using configuration properties that are prefixed with quarkus.

Fix: Upgrade this library to at least version 3.8.4 at core/tools/dotcms-cli/api-data-model/maven_dep_tree.txt:11.

Reference(s): GHSA-f8h5-v2vg-46rr, CVE-2024-2700

Ignore this finding from ssc-ffb00194-3ce4-4701-a3d0-7ebcdec196e5.

Semgrep found 3 ssc-edad62ae-dae3-44f1-950a-94488a700a38 findings:

Risk: Affected versions of org.elasticsearch:elasticsearch are vulnerable to Uncontrolled Resource Consumption. An unauthenticated user can induce an Elasticsearch node to exit with an OutOfMemory error by sending a moderate number of malformed HTTP requests, due to the way Elasticsearch handles incoming requests on the HTTP layer.

Fix: Upgrade this library to at least version 7.17.13 at core/dotcms-integration/maven_dep_tree.txt:167.

Reference(s): GHSA-2cqf-6xv9-f22w, CVE-2023-31418

Ignore this finding from ssc-edad62ae-dae3-44f1-950a-94488a700a38.

@spbolton spbolton force-pushed the issue-30610-add-semgrep-to-workflows branch from ae3fc78 to 4095b98 Compare November 11, 2024 14:07
@spbolton spbolton self-assigned this Nov 11, 2024
@spbolton spbolton marked this pull request as ready for review November 11, 2024 14:09
@spbolton
Copy link
Contributor Author

vars.SEMGREP_NO_FAIL is enabled to allow us to merge the base code into main without fixing the issues found at this time. We can remove this flag when we are ready.

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@spbolton spbolton added this pull request to the merge queue Nov 11, 2024
Merged via the queue into main with commit 4a3241d Nov 11, 2024
37 checks passed
@spbolton spbolton deleted the issue-30610-add-semgrep-to-workflows branch November 11, 2024 16:36
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.

Add Semgrep to workflows
3 participants