Repository navigation
[FSSDK-13470] Fix Arnica findings: allowlist JSON library reflection, bump quickstart Jackson - #645
Esra Kartal (esrakartalOpt) wants to merge 2 commits into
Conversation
… bump quickstart Jackson - Add JsonLibraryDetector: Class.forName is only called for an allowlist of supported JSON library classes and without initializing the class. Use it in DefaultConfigParser, JsonParserProvider and DefaultJsonSerializer (Arnica CWE-470 unsafe reflection findings). - Bump java-quickstart Jackson to 2.23.0 (jackson-annotations 2.23) to fix jackson-core and jackson-databind SCA findings. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Approved. Two small non-blocking suggestions:
|
… guard - Put the nosemgrep comment directly above Class.forName so Semgrep honours it. - Add JsonLibraryDetector.isAllowed and tests that check every ConfigParserSupplier and JsonParserProvider class name is allowlisted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Summary
JsonLibraryDetector, which only callsClass.forNamefor an allowlist of the four supported JSON library classes (Gson, Jackson,org.json,json-simple). It loads classes without initializing them, so no static initializer of the probed class runs.DefaultConfigParser,JsonParserProviderandDefaultJsonSerializer, replacing their directClass.forName(className)calls (Arnica CWE-470 unsafe reflection findings).java-quickstartJackson to 2.23.0 (jackson-core,jackson-databind) and 2.23 (jackson-annotations, which drops the patch version since Jackson 2.20). This fixes the SCA findings forjackson-core@2.17.0andjackson-databind@2.17.0.The three reflection findings were low risk: the class names come from hardcoded enum constants or string literals, never from user input. The allowlist makes that guarantee explicit and keeps one
Class.forNamecall, which carries anosemgrepcomment. Arnica may still flag it on the next scan. If so, dismiss it there with the allowlist as the reason.jackson-databind2.23.0 only fixes 75% of its known vulnerabilities, per Arnica, so re-scan after merge.Test plan
JsonLibraryDetectorTest: the four allowlisted libraries are detected, and non-allowlisted names (for examplejava.lang.Runtime),null, empty and unknown names are rejected../gradlew :core-api:test :core-httpclient-impl:testpass../gradlew :core-api:spotbugsMainand the license check pass../gradlew :java-quickstart:compileJavapasses, and the runtime classpath resolves Jackson to 2.23.0 / 2.23.Issues
🤖 Generated with Claude Code