# CVE-2020-5301: Information disclosure of source code in SimpleSAMLphp

> Attackers can view private source code of third-party modules by requesting uppercase .PHP paths on case-insensitive file systems.

- **Severity:** Low 3.0 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N`)
- **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:** 21 Apr 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-24m3-w8g9-jwpq

## What is CVE-2020-5301?

CVE-2020-5301 is a low-severity vulnerability in simplesamlphp, published on 21 Apr 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

SimpleSAMLphp versions before 1.18.6 contain an information disclosure vulnerability. The module controller in `SimpleSAML\Module` that processes requests for pages hosted by modules, has code to identify paths ending with `.php` and process those as PHP code. If no other suitable way of handling the given path exists it presents the file to the browser. The check to identify paths ending with `.php` does not account for uppercase letters. If someone requests a path ending with e.g. `.PHP` and the server is serving the code from a case-insensitive file system, such as on Windows, the processing of the PHP code does not occur, and the source code is instead presented to the browser. An attacker may use this issue to gain access to the source code in third-party modules that is meant to be private, or even sensitive. However, the attack surface is considered small, as the attack will only work when SimpleSAMLphp serves such content from a file system that is not case-sensitive, such as on Windows. This issue is fixed in version 1.18.6.

Weakness: CWE-178 (Improper Handling of Case Sensitivity), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2020-5301?

2 open source packages ship an affected version, including simplesamlphp/simplesamlphp. It affects 1 product.


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

Products: Simplesamlphp Simplesamlphp.

## How do I fix CVE-2020-5301?

Upgrade simplesamlphp/simplesamlphp to 1.18.6 or later.

## Is CVE-2020-5301 being exploited?

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

## Other vulnerabilities in simplesamlphp

- [CVE-2017-12868](https://insights.sbomify.com/CVE-2017-12868/): SimpleSAMLphp Session fixation issue and authentication bypass in the authcrypt module (critical 9.8)
- [CVE-2018-7644](https://insights.sbomify.com/CVE-2018-7644/): SimpleSAMLphp Improper Verification of Cryptographic Signature (high 7.5)
- [CVE-2026-49284](https://insights.sbomify.com/CVE-2026-49284/): SimpleSAMLphp SP accepts a response from an unexpected IdP when unsigned `Response/InResponseTo` is combined with a signed assertion lacking `SubjectConfirmationData/InResponseTo` (high 7.1)
- [CVE-2018-6520](https://insights.sbomify.com/CVE-2018-6520/): SimpleSAMLphp Open redirection protection bypass (medium 6.1)
- [CVE-2017-12870](https://insights.sbomify.com/CVE-2017-12870/): SimpleSAMLphp Unauthenticated encryption in CBC mode (medium 5.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-5301 and fix it if it is affected.

What it is: CVE-2020-5301 is a low-severity vulnerability in simplesamlphp, published on 21 Apr 2020. 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-2020-5301 in the wild and no public exploit code.

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

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

## Sources

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

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