# GHSA-2r3v-q9x3-7g46: Link injection in SimpleSAMLphp

> Attackers can trick users into visiting malicious sites via unvalidated links in SimpleSAMLphp logout and no-cookie pages.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 24 Jan 2020

## What is GHSA-2r3v-q9x3-7g46?

GHSA-2r3v-q9x3-7g46 is a vulnerability in simplesamlphp/simplesamlphp, published on 24 Jan 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

### Background
Several scripts part of SimpleSAMLphp display a web page with links obtained from the request parameters. This allows us to enhance usability, as the users are presented with links they can follow after completing a certain action, like logging out.

### Description
The following scripts were not checking the URLs obtained via the HTTP request before displaying them as the target of links that the user may click on:

- `www/logout.php`
- `modules/core/www/no_cookie.php`

The issue allowed attackers to display links targeting a malicious website inside a trusted site running SimpleSAMLphp, due to the lack of security checks involving the `link_href` and `retryURL` HTTP parameters, respectively. The issue was resolved by including a verification of the URLs received in the request against a white list of websites specified in the `trusted.url.domains` configuration option.

### Affected versions
All SimpleSAMLphp versions prior to 1.14.4.

### Impact
A remote attacker could craft a link pointing to a trusted website running SimpleSAMLphp, including a parameter pointing to a malicious website, and try to fool the victim into visiting that website by clicking on a link in the page presented by SimpleSAMLphp.

### Resolution
Upgrade to the latest version.

### Credit
This security issue was discovered and reported by John Page (hyp3rlinx).

## Which versions are affected by GHSA-2r3v-q9x3-7g46?

2 open source packages ship an affected version, including simplesamlphp/simplesamlphp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `simplesamlphp/simplesamlphp` | Packagist | All versions | 1.14.4 |
| `simplesamlphp/simplesamlphp` | Packagist | All versions | 1.14.4 |

## How do I fix GHSA-2r3v-q9x3-7g46?

Upgrade simplesamlphp/simplesamlphp to 1.14.4 or later.

## Is GHSA-2r3v-q9x3-7g46 being exploited?

There is no known exploitation of GHSA-2r3v-q9x3-7g46 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2r3v-q9x3-7g46 and fix it if it is affected.

What it is: GHSA-2r3v-q9x3-7g46 is a vulnerability in simplesamlphp/simplesamlphp, published on 24 Jan 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-2r3v-q9x3-7g46 in the wild and no public exploit code.

Affected packages and fixed versions:
- simplesamlphp/simplesamlphp (Packagist): affected all versions; fixed in 1.14.4
- simplesamlphp/simplesamlphp (Packagist): affected all versions; fixed in 1.14.4

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-2r3v-q9x3-7g46/ (Markdown: https://insights.sbomify.com/GHSA-2r3v-q9x3-7g46/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2r3v-q9x3-7g46

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2r3v-q9x3-7g46/
Summaries are generated and may contain mistakes; the official description above is the record.
