# GHSA-5684-g483-2249: Signature Validation Bypass

> Attackers can bypass SAML signature validation to access unauthorized accounts or achieve full authentication bypass in applications using the gosaml2 library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 May 2021

## What is GHSA-5684-g483-2249?

GHSA-5684-g483-2249 is an authentication bypass vulnerability in github.com/russellhaering/gosaml2, published on 24 May 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact
Given a valid SAML Response, an attacker can potentially modify the document, bypassing signature validation in order to pass off the altered document as a signed one.

This enables a variety of attacks, including users accessing accounts other than the one to which they authenticated in the identity provider, or full authentication bypass if an external attacker can obtain an expired, signed SAML Response.

### Patches
A patch is available, users of gosaml2 should upgrade to v0.5.0 or higher.

### References
See the [underlying advisory on goxmldsig](https://github.com/russellhaering/goxmldsig/security/advisories/GHSA-q547-gmf8-8jr7) for more details.

## Which versions are affected by GHSA-5684-g483-2249?

2 open source packages ship an affected version, including github.com/russellhaering/gosaml2.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/russellhaering/gosaml2` | Go | All versions | 0.5.0 |
| `github.com/russellhaering/gosaml2` | Go | All versions | 0.5.0 |

## How do I fix GHSA-5684-g483-2249?

Upgrade github.com/russellhaering/gosaml2 to 0.5.0 or later.

## Is GHSA-5684-g483-2249 being exploited?

There is no known exploitation of GHSA-5684-g483-2249 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-5684-g483-2249 and fix it if it is affected.

What it is: GHSA-5684-g483-2249 is an authentication bypass vulnerability in github.com/russellhaering/gosaml2, published on 24 May 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-5684-g483-2249 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/russellhaering/gosaml2 (Go): affected all versions; fixed in 0.5.0
- github.com/russellhaering/gosaml2 (Go): affected all versions; fixed in 0.5.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/GHSA-5684-g483-2249/ (Markdown: https://insights.sbomify.com/GHSA-5684-g483-2249/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-5684-g483-2249

---
From sbomify Insights: https://insights.sbomify.com/GHSA-5684-g483-2249/
Summaries are generated and may contain mistakes; the official description above is the record.
