Skip to content

fix: validate embedded app paths with filepath.IsLocal - #2721

Draft
dunglas wants to merge 1 commit into
mainfrom
fix/embed-islocal
Draft

dunglas wants to merge 1 commit into
mainfrom
fix/embed-islocal

Conversation

@dunglas

@dunglas dunglas commented Oct 16, 2026

Copy link
Copy Markdown
Member

Replaces the nativeRelPath helper copied from x/build with filepath.IsLocal, which rejects absolute paths, .. traversal, volume names and, on Windows, reserved names. The behavior is the same for valid archives and the code is shorter.

CodeQL recognizes filepath.IsLocal as a path sanitizer, which resolves https://github.com/php/frankenphp/security/code-scanning/1. The archive is embedded at build time, so this alert was not exploitable in practice.

Found while setting up CodeQL in #2720.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant