I am writing a small cross platform Python application (a package manager to be used internally by my corp), and I'm thinking of using something similar to this answer on Stack Overflow to check for administrator/root privileges. I noticed the author mentions vulnerabilities with environment variables.
It isn't surprising to me that environment variables are vulnerable to overflows, etc., and that they would probably represent significant attack surface. Could I have some specific examples of attacks against them, especially what my application may be exposed to if it relies on them? Both WinNT and Linux examples are welcome.
(Also -- for various reasons we cannot use existing package management solutions such as Nuget/APT. We maintain our own distribution of internal software and writing a small specialized solution is easier, especially targeting multiple platforms)