GEODE-10546: Address CVE-2025-48924 in Apache Commons Lang3 #7976
+18
−18
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.
GEODE-10546: Address CVE-2025-48924 in Apache Commons Lang3
Description
This PR addresses the security vulnerability CVE-2025-48924 (Uncontrolled Recursion in Apache Commons Lang3) by upgrading the commons-lang3 dependency from version 3.12.0 to 3.18.0 and replacing deprecated/removed methods with Java standard library equivalents.
Security Context
CVE-2025-48924: Uncontrolled Recursion (CWE-674) in
ClassUtils.getClass()method affecting commons-lang3 versions 3.0 through 3.17.x. The vulnerability could lead to stack overflow errors when processing deeply nested class hierarchies.Severity: Medium
Fixed in: commons-lang3 3.18.0
Changes Made
1. Dependency Upgrade
build-tools/geode-dependency-management/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy2. Code Refactoring (9 files)
Replaced deprecated StringUtils and LineIterator methods with Java standard library equivalents:
StringUtils.startsWith → String.startsWith
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/ConnectCommand.java(line 126)if (url != null && url.startsWith("https"))StringUtils.containsIgnoreCase → String.toLowerCase().contains()
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommand.java(lines 87-88)StringUtils.removeStart → Ternary with startsWith() + substring()
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java(line 172)geode-management/src/main/java/org/apache/geode/management/configuration/Index.java(line 91)StringUtils.equals → Objects.equals
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/domain/FixedPartitionAttributesInfo.java(line 40)geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/domain/RegionAttributesInfo.java(line 367)geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/domain/PartitionAttributesInfo.java(lines 155-157)import java.util.Objectswhere neededLineIterator.nextLine() → LineIterator.next()
geode-assembly/src/acceptanceTest/java/org/apache/geode/management/internal/cli/commands/StartServerCommandAcceptanceTest.java(lines 106, 155)Mockito Compatibility Fix
geode-core/src/test/java/org/apache/geode/internal/cache/ServerConnectionTest.java(line 310)mock(MutableInt.class)tonew MutableInt(0)due to bytecode changes in commons-lang3 3.18.0Testing
Unit Tests
./gradlew testBuild Verification
Breaking Changes
None. All changes maintain backward compatibility and use standard Java APIs.
Notes
MutableIntincompatible with Mockito's mock functionality, requiring the use of actual instances in tests.Related Issues
Checklist