Company
Date Published
Author
Dennis Brinkrolf
Word count
2561
Language
English
Hacker News points
None

Summary

Python developers often overlook subtle security pitfalls that can lead to severe vulnerabilities. These pitfalls include Optimized Asserts, which can be used to bypass authentication checks; MakeDirs Permissions, where the default permission of created folders can be misused; Absolute Path Joins, which can be exploited for path traversal attacks; Arbitrary Temp Files, where user-controlled input can be used to create malicious temporary files; Extended Zip Slip, a vulnerability in zip extraction that allows attackers to inject arbitrary file names; Incomplete Regex Match, where a regex deny list can be bypassed due to the behavior of re.match and re.search; Unicode Sanitizer Bypass, which occurs when user input is normalized using the NFKC algorithm; Unicode Case Collision, where a collision between different characters can lead to unexpected behavior; IP Address Normalization, where leading zeros are removed from IP addresses, allowing SSRF attacks to bypass validators; URL Query Parsing, where the use of semicolons and ampersands as separators can be exploited for web cache poisoning vulnerabilities. These pitfalls highlight the importance of carefully reading documentation, upgrading to the latest versions, and using best practices to prevent security vulnerabilities in Python applications.