CVE-2024-29131: Apache Commons Configuration StackOverflowError Adding Property Vulnerability

MODERATE
Advisory Identifier: GHSA-xjp4-hw94-mvp5
CVSS 6.5
CWE-787
Published
Advisory Summary

CVE-2024-29131 is a MODERATE (CVSS 6.5) stackoverflowerror adding property vulnerability (CWE-787: Out-of-bounds Write) affecting Apache Commons Configuration libraries in the Maven ecosystem. The issue involves stackoverflowerror adding property in abstractlistdelimiterhandler.flatteniterator(). Remediation is available by upgrading affected packages to version 2.10.1.

CVE-2024-29131 at a Glance

CVE Identifier CVE-2024-29131
GHSA Identifier GHSA-xjp4-hw94-mvp5
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Apache Commons Configuration
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-29131

To remediate this vulnerability, upgrade all affected Apache Commons Configuration dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.commons:commons-configuration2 fixed: 2.10.1
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-configuration2</artifactId>
    <version>2.10.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.commons

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-29131, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.commons

Analyze the terminal output to locate any version of Apache Commons Configuration in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.commons command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Apache Commons Configuration, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

This Out-of-bounds Write vulnerability in Apache Commons Configuration affects Apache Commons Configuration: from 2.0 before 2.10.1. User can see this as a 'StackOverflowError' when adding a property in 'AbstractListDelimiterHandler.flattenIterator()'. Users are recommended to upgrade to version 2.10.1, which fixes the issue.

CVE-2024-29131 Affected Apache Commons Configuration Versions

1 component(s)
Fixed Versions:
2.10.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.commons:commons-configuration2
Maven
≥ 2.0
< 2.10.1
2.10.1

References

Frequently Asked Questions

What is CVE-2024-29131?
CVE-2024-29131 is a security vulnerability in Apache Commons Configuration involving StackOverflowError adding property in AbstractListDelimiterHandler.flattenIterator() under CWE-787: Out-of-bounds Write.
Which Apache Commons Configuration versions are affected?
Affected versions include releases prior to 2.10.1 across affected packages: org.apache.commons:commons-configuration2.
What version fixes CVE-2024-29131?
Upgrading to 2.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is commons-configuration2 affected?
Yes, org.apache.commons:commons-configuration2 is affected in releases prior to 2.10.1. Upgrade your dependency to 2.10.1 or later.
What is the CVSS score of CVE-2024-29131?
CVE-2024-29131 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2024-29131?
CVE-2024-29131 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check Maven dependencies for CVE-2024-29131?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.commons'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xjp4-hw94-mvp5",
  "modified" : "2025-02-13T19:05:12Z",
  "published" : "2024-03-21T09:31:14Z",
  "aliases" : [ "CVE-2024-29131" ],
  "summary" : "Apache Commons Configuration: StackOverflowError adding property in AbstractListDelimiterHandler.flattenIterator()",
  "details" : "This Out-of-bounds Write vulnerability in Apache Commons Configuration affects Apache Commons Configuration: from 2.0 before 2.10.1. User can see this as a 'StackOverflowError' when adding a property in 'AbstractListDelimiterHandler.flattenIterator()'.\nUsers are recommended to upgrade to version 2.10.1, which fixes the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.commons:commons-configuration2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0"
      }, {
        "fixed" : "2.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-29131"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/commons-configuration/commit/56b5c4dcdffbde27870df5a3105d6a5f9b22f554"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/commons-configuration"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/CONFIGURATION-840"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/03nzzzjn4oknyw5y0871tw7ltj0t3r37"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SNKDKEEKZNL5FGCTZKJ6CFXFVWFL5FJ7"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YD4AFTIIQW662LUAQRMWS6BBKYSZG3YS"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20241213-0001"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/03/20/4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-21T18:58:52Z",
    "nvd_published_at" : "2024-03-21T09:15:07Z"
  }
}