# CVE-2026-5078: morgan vulnerable to Log Forging via unneutralized control characters in :remote-user

> An attacker can inject forged log lines via control characters in the Authorization header, compromising log integrity for applications using morgan.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Jun 2026
- **Updated:** 3 Jun 2026
- **Also known as:** CLSA-2026-1783904625, CLSA-2026-1784596308, DEBIAN-CVE-2026-5078, GHSA-4vj7-5mj6-jm8m, MINI-2c9r-9w23-79pr, MINI-9296-w7rg-c654, MINI-gmrj-qvqc-26q4, UBUNTU-CVE-2026-5078

## What is CVE-2026-5078?

CVE-2026-5078 is a medium-severity vulnerability in morgan, published on 3 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Impact: The morgan logging middleware's :remote-user token extracts the Basic auth username from the Authorization request header and writes it to the log stream without neutralizing control characters. An unauthenticated attacker can send a crafted Authorization Basic header containing CR or LF bytes to inject forged log lines, breaking the one-request-per-line structure of access logs and enabling log forgery against downstream log consumers. The built-in combined, common, default, and short formats are affected, as well as any custom format that references :remote-user. Affected versions: morgan 1.2.0 through 1.10.1. Patches: upgrade to morgan 1.11.0, which neutralizes control characters in the :remote-user token output. Workarounds: use a custom format string that does not include :remote-user.

Weakness: CWE-117 (Improper Output Neutralization for Logs)

## Which versions are affected by CVE-2026-5078?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `morgan` | npm | From 1.2.0 | 1.11.0 |
| `morgan` | npm | From 1.2.0 | 1.11.0 |

Products: Morgan Project Morgan.

## How do I fix CVE-2026-5078?

Upgrade morgan to 1.11.0 or later.

## Is CVE-2026-5078 being exploited?

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

## Other vulnerabilities in morgan

- [CVE-2019-5413](https://insights.sbomify.com/CVE-2019-5413/): Code Injection in morgan (critical 9.8)
- [CVE-2026-15603](https://insights.sbomify.com/CVE-2026-15603/): morgan vulnerable to Log Forging via unescaped Unicode line separators (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-5078 and fix it if it is affected.

What it is: CVE-2026-5078 is a medium-severity vulnerability in morgan, published on 3 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-5078 in the wild and no public exploit code.

Affected packages and fixed versions:
- morgan (npm): affected from 1.2.0; fixed in 1.11.0
- morgan (npm): affected from 1.2.0; fixed in 1.11.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/CVE-2026-5078/ (Markdown: https://insights.sbomify.com/CVE-2026-5078/index.md)
```

## Sources

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

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