Files
codeql/python/ql/test/experimental/dataflow/strange-essaflow/test.py
Rasmus Wriedt Larsen cf57afd102 Python: Add example of strange DataFlow::jumpStep
The example code is just copied from command injection tests, that is not too
important. The important part is that `jumpStep` says there is flow from the
import of `os` to `app.route()` :O
2020-09-04 14:39:16 +02:00

12 lines
227 B
Python

import os
from flask import Flask, request
app = Flask(__name__)
@app.route("/command1")
def command_injection1():
files = request.args.get('files', '')
# Don't let files be `; rm -rf /`
os.system("ls " + files)