Skip to content

Proof of concept exploit for Python Security Consideration "logging: Logging configuration uses eval()"

Notifications You must be signed in to change notification settings

raj3shp/python-logging.config-exploit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

python-logging.config-exploit

Proof of concept exploit for Python Security Consideration

"logging: Logging configuration uses eval()"

eval() is used to evaluate (execute) python expressions which makes it vulnerable to code execution if not used securely.

This is one of those low likelihood vulnerabilities where attacker must be able to modify the module configuration. When application loads malicious configuration, code is executed. Such attack is possible if write-access to configuration files is not restricted properly. Additionally, if an application exposes a socket server with logging.config.listen to listen for new configurations, a local attacker may be able to execute code with privileges of the user that is running the process which calls logging.

UPDATE: Bandit (security linter from PyCQA) accepted my PR for a plugin to audit for insecure usages of logging.config.listen

Read more about how the proof of concept works here.

Disclaimer

This project can only be used for educational purposes. Using this software against target systems without prior permission is illegal, and any damages from misuse of this software will not be the responsibility of the author.

About

Proof of concept exploit for Python Security Consideration "logging: Logging configuration uses eval()"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages