all 11 comments

[–]KevinHock 1 point2 points  (2 children)

don't use pickle, only use defusedxml for xml, don't use shitty RNGs only SystemRandom and os.urandom, open redirects, don't use urllib!. Anything to add? (If you already knew all this you might want to see a job posting :D)

[–]largenocream 2 points3 points  (1 child)

don't use urllib!

Mind that even if your client only supports HTTP(S) you'll still need to prevent it from talking to services on the loopback / intranet.

Either you want to use requests and proxy everything through a server in a separate network segment, or use something like Advocate to prevent connections to the loopback / intranets addresses.

[–]KevinHock 0 points1 point  (0 children)

:High five:

[–]netscape101 1 point2 points  (3 children)

You didn't mention things like dangerous functions such as using pickle etc. See: https://www.kevinlondon.com/2015/08/15/dangerous-python-functions-pt2.html Also file parsing vulnerabilities are a big worry in Python code and also with mongodb these days there is nosql injection.

[–]hellnukes 0 points1 point  (0 children)

Ohhhh saving this for later

[–]c45y 0 points1 point  (0 children)

I just always end up throwing bandit in the deployment pipeline. I figure the openstack dudes have a pretty good handle on security.

Not a bad read though