Skip to content

Commit

Permalink
Update code and add more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed May 14, 2024
1 parent 9d2f32e commit f3fd5ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
tokenizer-api:
build:
Expand Down
6 changes: 6 additions & 0 deletions vulnerable_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## How to run

```bash
pip install -r requirements.txt
python main.py
```
6 changes: 3 additions & 3 deletions vulnerable_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
def create_app():
app = Flask(__name__)

@app.route("/test/<string:test_id>")
def test(test_id):
@app.route("/customer/<string:customer_id>")
def customer(customer_id):
try:
# Connect to your postgres DB
conn = psycopg2.connect(
Expand All @@ -17,7 +17,7 @@ def test(test_id):
cur = conn.cursor()

# Execute a query
cur.execute(f"SELECT * FROM test WHERE id = {test_id};")
cur.execute(f"SELECT * FROM customer WHERE customer_id = {customer_id};")

# Retrieve query results
records = cur.fetchall()
Expand Down

0 comments on commit f3fd5ce

Please sign in to comment.