# CVE-2022-46166: Spring Boot Admins integrated notifier support allows arbitrary code execution

> Attackers with write access to environment variables can execute arbitrary code via integrated notifiers in Spring Boot Admin.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Dec 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-w3x5-427h-wfq6

## What is CVE-2022-46166?

CVE-2022-46166 is a high-severity code injection vulnerability in codecentric spring-boot-admin, published on 9 Dec 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Spring boot admins is an open source administrative user interface for management of spring boot applications. All users who run Spring Boot Admin Server, having enabled Notifiers (e.g. Teams-Notifier) and write access to environment variables via UI are affected. Users are advised to upgrade to the most recent releases of Spring Boot Admin 2.6.10 and 2.7.8 to resolve this issue. Users unable to upgrade may disable any notifier or disable write access (POST request) on `/env` actuator endpoint.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2022-46166?

6 open source packages ship an affected version, including de.codecentric:spring-boot-admin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `de.codecentric:spring-boot-admin` | Maven | All versions | 2.6.10 |
| `de.codecentric:spring-boot-admin` | Maven | All versions | 2.6.10 |
| `de.codecentric:spring-boot-admin` | Maven | From 2.7.0 | 2.7.8 |
| `de.codecentric:spring-boot-admin` | Maven | From 2.7.0 | 2.7.8 |
| `de.codecentric:spring-boot-admin` | Maven | From 3.0.0-M1 | 3.0.0-M6 |
| `de.codecentric:spring-boot-admin` | Maven | From 3.0.0-M1 | 3.0.0-M6 |

Products: Codecentric Spring Boot Admin.

## How do I fix CVE-2022-46166?

Upgrade de.codecentric:spring-boot-admin to a fixed version for your release line: 2.6.10, 2.7.8 or 3.0.0-M6.

## Is CVE-2022-46166 being exploited?

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

Public exploit code:

- https://github.com/shoucheng3/codecentric__spring-boot-admin_CVE-2022-46166_2-6-9 (github_poc): https://github.com/shoucheng3/codecentric__spring-boot-admin_CVE-2022-46166_2-6-9

## Other vulnerabilities in codecentric spring-boot-admin

- [CVE-2023-38286](https://insights.sbomify.com/CVE-2023-38286/): Spring-boot-admin sandbox bypass via crafted HTML (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-46166 and fix it if it is affected.

What it is: CVE-2022-46166 is a high-severity code injection vulnerability in codecentric spring-boot-admin, published on 9 Dec 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-46166 in the wild and no public exploit code.

Affected packages and fixed versions:
- de.codecentric:spring-boot-admin (Maven): affected all versions; fixed in 2.6.10
- de.codecentric:spring-boot-admin (Maven): affected all versions; fixed in 2.6.10
- de.codecentric:spring-boot-admin (Maven): affected from 2.7.0; fixed in 2.7.8
- de.codecentric:spring-boot-admin (Maven): affected from 2.7.0; fixed in 2.7.8
- de.codecentric:spring-boot-admin (Maven): affected from 3.0.0-M1; fixed in 3.0.0-M6
- de.codecentric:spring-boot-admin (Maven): affected from 3.0.0-M1; fixed in 3.0.0-M6

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-2022-46166/ (Markdown: https://insights.sbomify.com/CVE-2022-46166/index.md)
```

## Sources

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

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