mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
copy, pop, get, getitem, setdefault
Also add read steps to taint tracking.
Reading from a tainted collection can be done in two situations:
1. There is an acces path
In this case a read step (possibly from a flow summary)
gives rise to a taint step.
2. There is no access path
In this case an explicit taint step (possibly via a flow
summary) should exist.
18 lines
349 B
Python
18 lines
349 B
Python
import pathlib
|
|
|
|
from flask import Flask, request
|
|
app = Flask(__name__)
|
|
|
|
|
|
STATIC_DIR = pathlib.Path("/server/static/")
|
|
|
|
|
|
@app.route("/pathlib_use")
|
|
def path_injection():
|
|
filename = request.args.get('filename', '')
|
|
p = STATIC_DIR / filename
|
|
p.open() # $ result=BAD
|
|
|
|
p2 = pathlib.Path(STATIC_DIR, filename)
|
|
p2.open() # $ result=BAD
|