# CVE-2024-47197: Maven Archetype Plugin: Maven Archetype integration-test may package local settings into the published artifact, possibly containing credentials

> Developers using Maven Archetype Plugin may inadvertently publish local credentials to remote repositories due to insecure storage of settings during integration tests.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Sep 2024
- **Updated:** 17 Mar 2025
- **Also known as:** GHSA-2qq7-fch2-phqf, openSUSE-SU-2024:14372-1

## What is CVE-2024-47197?

CVE-2024-47197 is a high-severity vulnerability in Apache Software Foundation Maven Archetype Plugin, published on 26 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Exposure of Sensitive Information to an Unauthorized Actor, Insecure Storage of Sensitive Information vulnerability in Maven Archetype Plugin.

This issue affects Maven Archetype Plugin: from 3.2.1 before 3.3.0.

Users are recommended to upgrade to version 3.3.0, which fixes the issue.

Archetype integration testing creates a file
called ./target/classes/archetype-it/archetype-settings.xml
This file contains all the content from the users ~/.m2/settings.xml file,
which often contains information they do not want to publish. We expect that on many developer machines, this also contains
credentials.

When the user runs mvn verify again (without a mvn clean), this file becomes part of
the final artifact.

If a developer were to publish this into Maven Central or any other remote repository (whether as a release
or a snapshot) their credentials would be published without them knowing.

Weakness: CWE-922 (Insecure Storage of Sensitive Information), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2024-47197?

2 open source packages ship an affected version, including org.apache.maven.plugins:maven-archetype-plugin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.maven.plugins:maven-archetype-plugin` | Maven | From 3.2.1 | 3.3.0 |
| `org.apache.maven.plugins:maven-archetype-plugin` | Maven | From 3.2.1 | 3.3.0 |
| `maven-archetype` | openSUSE:Tumbleweed | All versions | 3.3.0-1.1 |

Products: Apache Maven Archetype.

## How do I fix CVE-2024-47197?

Upgrade org.apache.maven.plugins:maven-archetype-plugin to 3.3.0 or later.

## Is CVE-2024-47197 being exploited?

There is no known exploitation of CVE-2024-47197 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-47197 and fix it if it is affected.

What it is: CVE-2024-47197 is a high-severity vulnerability in Apache Software Foundation Maven Archetype Plugin, published on 26 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-47197 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.maven.plugins:maven-archetype-plugin (Maven): affected from 3.2.1; fixed in 3.3.0
- org.apache.maven.plugins:maven-archetype-plugin (Maven): affected from 3.2.1; fixed in 3.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-47197/ (Markdown: https://insights.sbomify.com/CVE-2024-47197/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-47197
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-47197
- OSV: https://osv.dev/vulnerability/CVE-2024-47197

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-47197/
Summaries are generated and may contain mistakes; the official description above is the record.
