[Java} Enable SCA reachability system tests#6937
Draft
jandro996 wants to merge 2 commits into
Draft
Conversation
- Add ScaReachability.java controller to spring-boot weblog with /sca/vulnerable-call and /sca/vulnerable-call-alt endpoints (call snakeyaml Yaml.load(), vulnerable via GHSA-mjmj-j48q-9wg2) - Add Java entry to _LANG_CONFIG in test_sca_reachability.py (org.yaml:snakeyaml, callsite: ScaReachability.scaVulnerableCall) - Enable SCA reachability tests for spring-boot in manifests/java.yml (v1.63.0-SNAPSHOT, all other weblogs irrelevant) Relates to DataDog/dd-trace-java#11352
Contributor
|
|
|
✨ Fix all issues with BitsAI or with Cursor
|
Force org.yaml.snakeyaml.Yaml to load during Spring context initialization, before any HTTP request. This ensures the SCA transformer registers the CVE with reached=[] on startup, and a telemetry heartbeat can send that state before test setups call /sca/vulnerable-call. Without this, the class loads lazily on the first endpoint request, making registerCve() and recordHit() fire in the same request with no heartbeat window between them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ScaReachability.javacontroller to the spring-boot weblog exposing/sca/vulnerable-calland/sca/vulnerable-call-altendpoints that invokeorg.yaml.snakeyaml.Yaml.load()(vulnerable via GHSA-mjmj-j48q-9wg2 — snakeyaml<= 1.33; Spring Boot 2.6.0 ships 1.29)javaentry to_LANG_CONFIGintest_sca_reachability.pywith expected CVE, dependency name, and callsite class/methodmanifests/java.ymlforspring-boot: v1.63.0-SNAPSHOT; all other weblogs markedirrelevantCompanion tracer PR
DataDog/dd-trace-java#11352 — SCA Reachability runtime detection (APPSEC-62260)
Test plan
RUNTIME_SCA_REACHABILITYscenario against spring-boot weblog withDD_APPSEC_SCA_ENABLED=trueorg.yaml:snakeyamlappears inapp-dependencies-loadedtelemetry withmetadata[type=reachability]reached:[]at startup andreached:[{path, symbol, line}]after/sca/vulnerable-callis hit/sca/vulnerable-call-altdoes not overwrite the first callsite