first commit
This commit is contained in:
commit
edb8bb8137
13 files changed
+66
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# main.py
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/{user_input}", response_class=HTMLResponse)
|
||||
async def read_user_input(user_input: str):
|
||||
# Esta línea introduce una vulnerabilidad XSS porque el input del usuario se
|
||||
# devuelve directamente en la respuesta sin ninguna sanitización o escape.
|
||||
# Un atacante podría ingresar un script como parte de user_input.
|
||||
return f"<html><body><h1>Your input was: {user_input}</h1></body></html>"
|
||||
|
||||
|
||||
Reference in new issue
Block a user