Warning: os.path.join surprising behaviour
>>> os.path.join("/a/b/c", "/d/e/f")
"/d/e/f"
This can be a problem if “/d/e/f” comes from an untrusted source.
As a safety measure, avoid using os.path.join in your web applications, roll your own and call it “safe_join”. You will sleep better.
About this entry
You’re currently reading “ Warning: os.path.join surprising behaviour ,” an entry on Chui's Counterpoint
- Published:
- 6.19.07 / 1pm
- Category:
- IronPython, Python
7 Comments
Jump to comment form | comments rss [?] | trackback uri [?]