# GHSA-V7HF-4GQV-HF8P: php\_server with a worker match rule can serve the source of PHP scripts

- Database: GitHub
- Severity: CVSS 5.9 (Medium)
- Published: 2026-11-05
- Modified: 2026-11-05

## Affected versions

- github.com/dunglas/frankenphp/caddy (Go): from 1.8.0, through 1.13.4

## Description

### Impact

When a `php_server` block has a worker with a `match` rule and the built-in file server is enabled (the default), the raw source of some scripts under the document root can be downloaded instead of executed:

- with extra script extensions declared with `split` (e.g. `split .php .phtml`), `GET /report.phtml` returns the source of `report.phtml`;
- with a rewrite running before `php_server` that produces a script path ending with `/` (for instance `/app/config.php/./` behind `handle_path` or `uri strip_prefix`), the source of any `.php` script is returned.

The leaked source can contain credentials and other secrets. Nothing is executed or modified, and files outside the document root are not reachable.

### Patches

Fixed in 1.13.5.

### Workarounds

Disable the built-in file server with `file_server off` in `php_server` and serve static files with a separate `file_server` directive, or don't use `match` in `worker` blocks.

### Details

When a worker has a `match` pattern, `php_server` adds a `file_server` route before all its other routes, so existing static files are served before the request reaches the worker. This route excluded scripts with a hard-coded `*.php` path pattern, while the PHP route handles `*<ext>` and `*<ext>/*` for every extension listed in `split`. Paths in the second set but not the first were served as static files. For `/config.php/`, the `path` matcher keeps the trailing slash, while the `file` matcher and the file server drop it.

The exclusion now uses the same path patterns as the PHP route.

### Proof of concept

```caddyfile
http://localhost {
	php_server {
		root /srv/app
		split .php .phtml
		worker {
			file /srv/worker.php
			match /api/*
		}
	}
}
```

```console
$ curl http://localhost/report.phtml   # returns the source of /srv/app/report.phtml
```

### Credits

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-9HGVH264.

## References

- https://github.com/php/frankenphp/security/advisories/GHSA-v7hf-4gqv-hf8p

Page: https://cve.now/GHSA-V7HF-4GQV-HF8P

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
