# CVE-2022-31066: Configuration API in EdgeXFoundry exposes message bus credentials to local unauthenticated users

> Local unauthenticated users can access message bus credentials in security-enabled mode, allowing data interception or injection.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Jun 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-g63h-q855-vp3q, GO-2022-0491

## What is CVE-2022-31066?

CVE-2022-31066 is a medium-severity vulnerability in edgexfoundry edgex-go, published on 14 Jun 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

EdgeX Foundry is an open source project for building a common open framework for Internet of Things edge computing. Prior to version 2.1.1, the /api/v2/config endpoint exposes message bus credentials to local unauthenticated users. In security-enabled mode, message bus credentials are supposed to be kept in the EdgeX secret store and require authentication to access. This vulnerability bypasses the access controls on message bus credentials when running in security-enabled mode. (No credentials are required when running in security-disabled mode.) As a result, attackers could intercept data or inject fake data into the EdgeX message bus. Users should upgrade to EdgeXFoundry Kamakura release (2.2.0) or to the June 2022 EdgeXFoundry LTS Jakarta release (2.1.1) to receive a patch. More information about which go modules, docker containers, and snaps contain patches is available in the GitHub Security Advisory. There are currently no known workarounds for this issue.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

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

8 open source packages ship an affected version, including github.com/edgexfoundry/app-functions-sdk-go/v2, github.com/edgexfoundry/app-functions-sdk-go and github.com/edgexfoundry/device-sdk-go. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/edgexfoundry/app-functions-sdk-go/v2` | Go | All versions | 2.1.1 |
| `github.com/edgexfoundry/app-functions-sdk-go/v2` | Go | All versions | 2.1.1 |
| `github.com/edgexfoundry/app-functions-sdk-go/v2` | Go | All versions | 2.1.1 |
| `github.com/edgexfoundry/app-functions-sdk-go` | Go | All versions | None |
| `github.com/edgexfoundry/device-sdk-go` | Go | All versions | None |
| `github.com/edgexfoundry/device-sdk-go/v2` | Go | All versions | 2.1.1 |
| `github.com/edgexfoundry/device-sdk-go/v2` | Go | All versions | 2.1.1 |
| `github.com/edgexfoundry/device-sdk-go/v2` | Go | All versions | 2.1.1 |

Products: Edgexfoundry Edgex Foundry.

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

Upgrade github.com/edgexfoundry/app-functions-sdk-go/v2 to 2.1.1 or later.

## Is CVE-2022-31066 being exploited?

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

## Other vulnerabilities in edgexfoundry edgex-go

- [CVE-2021-32753](https://insights.sbomify.com/CVE-2021-32753/): Hardcoded credentials in edgex-go (high 8.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-31066 is a medium-severity vulnerability in edgexfoundry edgex-go, published on 14 Jun 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-31066 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/edgexfoundry/app-functions-sdk-go/v2 (Go): affected all versions; fixed in 2.1.1
- github.com/edgexfoundry/app-functions-sdk-go/v2 (Go): affected all versions; fixed in 2.1.1
- github.com/edgexfoundry/app-functions-sdk-go/v2 (Go): affected all versions; fixed in 2.1.1
- github.com/edgexfoundry/app-functions-sdk-go (Go): affected all versions; no fix listed
- github.com/edgexfoundry/device-sdk-go (Go): affected all versions; no fix listed
- github.com/edgexfoundry/device-sdk-go/v2 (Go): affected all versions; fixed in 2.1.1
- github.com/edgexfoundry/device-sdk-go/v2 (Go): affected all versions; fixed in 2.1.1
- github.com/edgexfoundry/device-sdk-go/v2 (Go): affected all versions; fixed in 2.1.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/CVE-2022-31066/ (Markdown: https://insights.sbomify.com/CVE-2022-31066/index.md)
```

## Sources

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

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