Cyber Risks · Google Project Zero

The Definitive Guide on Win32 to NT Path Conversion

Summary: Project Zero's James Forshaw published a 2016 guide showing that Win32 file paths pass through RtlDosPathNameToRelativeNtPathName_U, which sorts them into 7 path types and canonicalizes them by converting forward slashes, collapsing separators, resolving dot and double-dot elements, and stripping trailing spaces and dots. The post states that incorrect handling of Win32 paths can lead to security vulnerabilities, and that the documentation is incomplete relative to what the OS actually implements.

What's compelling: Any code that takes an untrusted path and either skips sanitization or sanitizes without understanding all 7 path types and the canonicalization rules can be exploited, which is how a colleague's path-handling vulnerability was found and then extended using barely documented conversion behavior.

Read the original at Google Project Zero ↗

Topics
Vulnerabilities & Patching
Related