# GHSA-XH92-4P94-CH7X: php\_server serves the Caddyfile when it is stored in the document root

- Database: GitHub
- Severity: CVSS 3.7 (Low)
- Published: 2026-11-05
- Modified: 2026-11-05

## Affected versions

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

## Description

### Impact

When the Caddyfile, or a file it imports, is stored under the document root of a `php_server` site, any client can download it with a `GET /Caddyfile` request. Values written inline in the Caddyfile, such as `env` values passed to PHP, Mercure JWT keys or `basic_auth` password hashes, are disclosed. Values referenced with `{$VAR}` or `{env.VAR}` are not.

This happens with the minimal layout shown in the documentation: a Caddyfile next to `index.php`, with no `root`, and FrankenPHP started from that directory. Caddy's `file_server` directive hides these files, and so does the `php` + `file_server` configuration documented as equivalent to `php_server`.

### Patches

Fixed in 1.13.5.

### Workarounds

Store the Caddyfile and its imports outside the document root, for instance by moving the PHP application to a `public/` subdirectory and setting `root`. Alternatively, block the request before `php_server`, for instance with `respond /Caddyfile 404`.

### Details

Caddy's `file_server` directive adds the Caddyfile being adapted and its imports to the `hide` list of the handler. This is done in `FileServer.FinalizeUnmarshalCaddyfile()`. `php_server` builds its file server without this step, so both the file server it adds at the end of its routes and the one it adds for `worker { match }` had an empty `hide` list.

`php_server` now calls `FinalizeUnmarshalCaddyfile()` on its file server.

### Proof of concept

`/srv/app/Caddyfile`:

```caddyfile
http://localhost {
	php_server {
		env DATABASE_PASSWORD secret
	}
}
```

```console
$ cd /srv/app && frankenphp run
$ curl http://localhost/Caddyfile   # returns the Caddyfile
```

### Credits

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-30F8W2OH.

## References

- https://github.com/php/frankenphp/security/advisories/GHSA-xh92-4p94-ch7x

Page: https://cve.now/GHSA-XH92-4P94-CH7X

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