Difference between revisions of "Relative path library search"
|Line 1:||Line 1:|
|Line 61:||Line 60:|
Revision as of 13:33, 16 May 2006
Certain functions perform automatic path searching. The method and results of this path searching may not be as expected. Example: WinExec will use the space character as a delimiter, finding "C:\Program.exe" as an acceptable result for a search for "C:\Program Files\Foo\Bar.exe".
- Authorization: There is the potential for arbitrary code execution with privileges of the vulnerable program.
- Implementation: This flaw is a simple logic issue, introduced entirely at implementation time.
- Languages: Any
- Operating platforms: Any
Likelihood of exploit
Avoidance and mitigation
- Implementation: Use other functions which require explicit paths. Making use of any of the other readily available functions which require explicit paths is a safe way to avoid this problem.
If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as "C:\Program.exe" to be run by a privileged program making use of WinExec.
UINT errCode = WinExec( "C:\\Program Files\\Foo\\Bar", SW_SHOW );