Werkzeug safe_join() allows Windows special device names
Description
Published to the GitHub Advisory Database
Feb 19, 2026
Reviewed
Feb 19, 2026
Published by the National Vulnerability Database
Feb 21, 2026
Last updated
Feb 23, 2026
Werkzeug's
safe_joinfunction allows Windows device names as filenames if when preceded by other path segments.This was previously reported as GHSA-hgf8-39gv-g3f2, but the added filtering failed to account for the fact that
safe_joinaccepts paths with multiple segments, such asexample/NUL.send_from_directoryusessafe_jointo safely serve files at user-specified paths under a directory. If the application is running on Windows, and the requested path ends with a special device name, the file will be opened successfully, but reading will hang indefinitely.References