# GHSA-vhj5-x93p-67jw: actix-web-lab has host header poisoning in redirect middleware can generate attacker-controlled absolute redirects

> Attacker can poison Host headers to generate malicious absolute redirects in actix-web-lab middleware, enabling phishing attacks.

- **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:** 11 Mar 2026

## What is GHSA-vhj5-x93p-67jw?

GHSA-vhj5-x93p-67jw is a vulnerability in actix-web-lab, published on 11 Mar 2026. 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

### Summary
`actix-web-lab` redirect middleware uses request-derived host information to construct absolute redirect URLs (for example, `https://{hostname}{path}`). In deployments without strict host allowlisting, an attacker can supply a malicious Host header and poison the `Location` response header, causing open redirect/phishing behavior.

### CVE
Assigned CVE ID:  CVE-2025-63762

### Details
The issue is in redirect middleware paths that construct absolute URLs from `req.connection_info()`:

1. `actix-web-lab/src/redirect_to_https.rs` (around lines 119-132)
   - `let host = conn_info.host();`
   - `format!("https://{hostname}{path}")`
   - `format!("https://{hostname}:{port}{path}")`

2. `actix-web-lab/src/redirect_to_www.rs` (around lines 30-35)
   - `format!("{scheme}://www.{host}{path}")`

3. `actix-web-lab/src/redirect_to_non_www.rs` (around lines 30-34)
   - `format!("{scheme}://{host_no_www}{path}")`

Because host values come from request connection metadata, untrusted Host input can influence redirect targets when deployment-side host validation is missing.

### PoC
Environment used for validation:
- Local minimal Actix apps using `actix-web-lab` middleware
- RedirectHttps: `http://127.0.0.1:18080`
- redirect_to_www: `http://127.0.0.1:18081`
- redirect_to_non_www: `http://127.0.0.1:18082`

Reproduction (RedirectHttps):
```bash
curl.exe -i -s "http://127.0.0.1:18080/test" -H "Host: attacker.example"
```

Observed response:
```http
HTTP/1.1 307 Temporary Redirect
location: https://attacker.example/test
```

Additional verification:
```bash
curl.exe -i -s "http://127.0.0.1:18080/abc/def" -H "Host: evil.example:9999"
```

Observed response:
```http
HTTP/1.1 307 Temporary Redirect
location: https://evil.example/abc/def
```

Reproduction (redirect_to_www):
```bash
curl.exe -i -s "http://127.0.0.1:18081/hello" -H "Host: attacker.example"
```

Observed response:
```http
HTTP/1.1 307 Temporary Redirect
location: http://www.attacker.example/hello
```

Reproduction (redirect_to_non_www):
```bash
curl.exe -i -s "http://127.0.0.1:18082/path" -H "Host: www.attacker.example"
```

Observed response:
```http
HTTP/1.1 307 Temporary Redirect
location: http://attacker.example/path
```

### Impact
This is a Host header poisoning / open redirect issue. Users can be redirected to attacker-controlled domains, enabling phishing and trust-boundary abuse. Any application using these middleware paths without strict host validation (proxy/app allowlisting) is impacted.

## Which versions are affected by GHSA-vhj5-x93p-67jw?

2 open source packages ship an affected version, including actix-web-lab.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `actix-web-lab` | crates.io | All versions | 0.26.0 |
| `actix-web-lab` | crates.io | All versions | 0.26.0 |

## How do I fix GHSA-vhj5-x93p-67jw?

Upgrade actix-web-lab to 0.26.0 or later.

## Is GHSA-vhj5-x93p-67jw being exploited?

There is no known exploitation of GHSA-vhj5-x93p-67jw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-vhj5-x93p-67jw and fix it if it is affected.

What it is: GHSA-vhj5-x93p-67jw is a vulnerability in actix-web-lab, published on 11 Mar 2026. 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-vhj5-x93p-67jw in the wild and no public exploit code.

Affected packages and fixed versions:
- actix-web-lab (crates.io): affected all versions; fixed in 0.26.0
- actix-web-lab (crates.io): affected all versions; fixed in 0.26.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-vhj5-x93p-67jw/ (Markdown: https://insights.sbomify.com/GHSA-vhj5-x93p-67jw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-vhj5-x93p-67jw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-vhj5-x93p-67jw/
Summaries are generated and may contain mistakes; the official description above is the record.
