# GHSA-mc84-xr9p-938r: High severity vulnerability that affects generator-jhipster

> Generated build files use HTTP for repositories, allowing man-in-the-middle attacks to inject malicious code during build.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Sep 2019

## What is GHSA-mc84-xr9p-938r?

GHSA-mc84-xr9p-938r is a vulnerability in generator-jhipster, published on 23 Sep 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

## Generated code uses repository configuration that downloads over HTTP instead of HTTPS

### Impact
Gradle users were using the http://repo.spring.io/plugins-release repositories in plain HTTP, and not HTTPS, so a man-in-the-middle attack was possible at build time.

### Patches

Maven users should at least upgrade to 6.3.0 while Gradle users should update to 6.3.1.
If you are not able to upgrade make sure not to use a Maven repository via `http` in your build file.

### Workarounds

Replace all custom repository definitions in `build.gradle` or `pom.xml` with their `https` version.

e.g.

```xml
 <repository>
            <id>oss.sonatype.org-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url> // <-- must be httpS
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
</repository>
```

```gradle
maven { url "https://repo.spring.io/plugins-release" } // <-- must be httpS
```

### References
* https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
* https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [https://github.com/jhipster/generator-jhipster/issues](https://github.com/jhipster/generator-jhipster/issues)

## Which versions are affected by GHSA-mc84-xr9p-938r?

2 open source packages ship an affected version, including generator-jhipster.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `generator-jhipster` | npm | All versions | 6.3.1 |
| `generator-jhipster` | npm | All versions | 6.3.1 |

## How do I fix GHSA-mc84-xr9p-938r?

Upgrade generator-jhipster to 6.3.1 or later.

## Is GHSA-mc84-xr9p-938r being exploited?

There is no known exploitation of GHSA-mc84-xr9p-938r in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mc84-xr9p-938r and fix it if it is affected.

What it is: GHSA-mc84-xr9p-938r is a vulnerability in generator-jhipster, published on 23 Sep 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-mc84-xr9p-938r in the wild and no public exploit code.

Affected packages and fixed versions:
- generator-jhipster (npm): affected all versions; fixed in 6.3.1
- generator-jhipster (npm): affected all versions; fixed in 6.3.1

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/GHSA-mc84-xr9p-938r/ (Markdown: https://insights.sbomify.com/GHSA-mc84-xr9p-938r/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mc84-xr9p-938r

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mc84-xr9p-938r/
Summaries are generated and may contain mistakes; the official description above is the record.
