bandit icon indicating copy to clipboard operation
bandit copied to clipboard

Add a plugin to detect os.join with input

Open ericwb opened this issue 6 years ago • 2 comments

Transfer of OpenStack blueprint to GH issue: https://blueprints.launchpad.net/bandit/+spec/add-os-join-plugin

If os.join is used with un-filtered user input it can lead to path traversal. A plugin that detects its use could be useful for pentesting.

ericwb avatar Apr 12 '19 14:04 ericwb

It's acutally os.path.join()! The vulnerability here is that user_input = '/tmp/foo' os.path.join('/var/cache/', user_input) will result in user_input.

spaceone avatar Aug 23 '19 08:08 spaceone

I've implemented something like this out of the bandit repo:

https://github.com/bugsink/spoils/

No check on user_input (yet) though.

vanschelven avatar Jul 30 '25 12:07 vanschelven