# CVE-2017-9303: Laravel does not properly constrain the host portion of a password-reset URL

> Attackers can manipulate password-reset URLs to redirect users to malicious hosts, facilitating phishing attacks against Laravel applications.

- **Severity:** Medium 6.1 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **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:** 29 May 2017
- **Updated:** 5 Aug 2024
- **Also known as:** GHSA-rc8x-jrrc-frfv

## What is CVE-2017-9303?

CVE-2017-9303 is a medium-severity vulnerability in n/a, published on 29 May 2017. 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

Laravel 5.4.x before 5.4.22 does not properly constrain the host portion of a password-reset URL, which makes it easier for remote attackers to conduct phishing attacks by specifying an attacker-controlled host.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2017-9303?

10 open source packages ship an affected version, including illuminate/auth, laravel/framework and laravel/laravel. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `illuminate/auth` | Packagist | From 5.3.0 to 5.3.31 | None |
| `illuminate/auth` | Packagist | From 5.3.0 to 5.3.31 | None |
| `illuminate/auth` | Packagist | From 5.4.0 | 5.4.22 |
| `illuminate/auth` | Packagist | From 5.4.0 | 5.4.22 |
| `laravel/framework` | Packagist | From 5.3.0 to 5.3.31 | None |
| `laravel/framework` | Packagist | From 5.3.0 to 5.3.31 | None |
| `laravel/framework` | Packagist | From 5.4.0 | 5.4.22 |
| `laravel/framework` | Packagist | From 5.4.0 | 5.4.22 |
| `laravel/laravel` | Packagist | From 5.4.0 | 5.4.22 |
| `laravel/laravel` | Packagist | From 5.4.0 | 5.4.22 |

Products: Laravel Laravel.

## How do I fix CVE-2017-9303?

Upgrade illuminate/auth to 5.4.22 or later.

## Is CVE-2017-9303 being exploited?

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

## Other vulnerabilities in n/a

- [CVE-2018-15133](https://insights.sbomify.com/CVE-2018-15133/): Laravel Deserialization of Untrusted Data (high 8.1, exploited in the wild)
- [CVE-2021-28254](https://insights.sbomify.com/CVE-2021-28254/): Deserialization in n/a (critical 9.8)
- [CVE-2020-24940](https://insights.sbomify.com/CVE-2020-24940/): Guard bypass in Eloquent models affecting Laravel illuminate database component (high 7.5)
- [CVE-2020-24941](https://insights.sbomify.com/CVE-2020-24941/): Improper Input Validation in Laravel (high 7.5)
- [CVE-2017-16894](https://insights.sbomify.com/CVE-2017-16894/): Information disclosure in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-9303 and fix it if it is affected.

What it is: CVE-2017-9303 is a medium-severity vulnerability in n/a, published on 29 May 2017. 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 CVE-2017-9303 in the wild and no public exploit code.

Affected packages and fixed versions:
- illuminate/auth (Packagist): affected from 5.3.0 up to 5.3.31; no fix listed
- illuminate/auth (Packagist): affected from 5.3.0 up to 5.3.31; no fix listed
- illuminate/auth (Packagist): affected from 5.4.0; fixed in 5.4.22
- illuminate/auth (Packagist): affected from 5.4.0; fixed in 5.4.22
- laravel/framework (Packagist): affected from 5.3.0 up to 5.3.31; no fix listed
- laravel/framework (Packagist): affected from 5.3.0 up to 5.3.31; no fix listed
- laravel/framework (Packagist): affected from 5.4.0; fixed in 5.4.22
- laravel/framework (Packagist): affected from 5.4.0; fixed in 5.4.22
- laravel/laravel (Packagist): affected from 5.4.0; fixed in 5.4.22
- laravel/laravel (Packagist): affected from 5.4.0; fixed in 5.4.22

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

## Sources

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

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