importosdirectory="/tmp"# Use of unsanitized data to create a processos.spawnl(os.P_WAIT,"/bin/ls")os.spawnle(os.P_WAIT,"/bin/ls")os.spawnlp(os.P_WAIT,"/bin/ls")os.spawnlpe(os.P_WAIT,"/bin/ls")os.spawnv(os.P_WAIT,"/bin/ls")os.spawnve(os.P_WAIT,"/bin/ls")os.spawnvp(os.P_WAIT,"/bin/ls")os.spawnvpe(os.P_WAIT,"/bin/ls")os.spawnvpe(os.P_WAIT,"/bin/ls "+directory)
Compliant Code Examples
importosimportshlex# Use of shlex() to sanitize dataos.spawnl(os.P_WAIT,shlex.escape("/bin/ls"))
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- python-security # Rules to enforce Python security.