# CVE-2023-48703: SAML authentication bypass vulnerability in RobotsAndPencils/go-saml

> Attackers can bypass SAML authentication by embedding their own public key in assertions, allowing unauthorized access to applications using this Go library.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 6 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-6h53-q94j-348w, GO-2024-3048

## What is CVE-2023-48703?

CVE-2023-48703 is a high-severity authentication bypass vulnerability in RobotsAndPencils go-saml, published on 6 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

RobotsAndPencils go-saml, a SAML client library written in Go, contains an authentication bypass vulnerability in all known versions. This is due to how the `xmlsec1` command line tool is called internally to verify the signature of SAML assertions. When `xmlsec1` is used without defining the enabled key data, the origin of the public key for the signature verification is, unfortunately, not restricted. That means an attacker can sign the SAML assertions themselves and provide the required public key (e.g. an RSA key) directly embedded in the SAML token. Projects still using RobotsAndPencils/go-saml should move to another SAML library or alternatively remove support for SAML from their projects. The vulnerability can likely temporarily be fixed by forking the go-saml project and adding the command line argument `--enabled-key-data` and specifying a value such as `x509` or `raw-x509-cert` when calling the `xmlsec1` binary in the verify function. Please note that this workaround must be carefully tested before it can be used.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2023-48703?

3 open source packages ship an affected version, including github.com/RobotsAndPencils/go-saml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/RobotsAndPencils/go-saml` | Go | All versions | None |
| `github.com/RobotsAndPencils/go-saml` | Go | All versions to 0.0.0-20230606195814-29020529affc | None |
| `github.com/RobotsAndPencils/go-saml` | Go | All versions to 0.0.0-20230606195814-29020529affc | None |

Products: Robotsandpencils Go-Saml.

## How do I fix CVE-2023-48703?

No fix has been published for CVE-2023-48703 yet. Limit exposure of the affected software until one is available.

## Is CVE-2023-48703 being exploited?

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

## Other vulnerabilities in RobotsAndPencils go-saml

- [CVE-2020-36563](https://insights.sbomify.com/CVE-2020-36563/): Weak hash (SHA-1) in github.com/RobotsAndPencils/go-saml (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-48703 and fix it if it is affected.

What it is: CVE-2023-48703 is a high-severity authentication bypass vulnerability in RobotsAndPencils go-saml, published on 6 Mar 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-2023-48703 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/RobotsAndPencils/go-saml (Go): affected all versions; no fix listed
- github.com/RobotsAndPencils/go-saml (Go): affected all versions up to 0.0.0-20230606195814-29020529affc; no fix listed
- github.com/RobotsAndPencils/go-saml (Go): affected all versions up to 0.0.0-20230606195814-29020529affc; no fix listed

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

## Sources

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

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