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

Medium 5.3 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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

Which versions are affected by CVE-2026-5078?

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

PackageAffectedFixed in
morgan npmFrom 1.2.01.11.0
morgan npmFrom 1.2.01.11.0

Products include 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.

Sources

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 and 2 more.

Is CVE-2026-5078 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free