-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce archive.tira.io to prepare for usage in pyterrier-artifacts #671
base: main
Are you sure you want to change the base?
Conversation
Development
update pyterrier-artifacts to main
return JsonResponse(ret[0], safe=False) | ||
else: | ||
return HttpResponseNotFound( | ||
json.dumps({"status": 1, "message": f"Could not find a software '{software}' by user '{user_id}'."}) |
Check warning
Code scanning / CodeQL
Reflected server-side cross-site scripting Medium
user-provided value
Cross-site scripting vulnerability due to a
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 7 days ago
To fix the problem, we need to escape the user_id
and software
parameters before including them in the JSON response message. This can be done using the html.escape()
function from the standard library to ensure that any special characters are properly escaped, preventing XSS attacks.
We will modify the code in the software_details
function to escape the user_id
and software
parameters before including them in the JSON response message. This change will be made in the file application/src/tira_app/endpoints/v1/_systems.py
.
-
Copy modified line R2 -
Copy modified line R53
@@ -1,2 +1,3 @@ | ||
import json | ||
import html | ||
|
||
@@ -51,3 +52,3 @@ | ||
return HttpResponseNotFound( | ||
json.dumps({"status": 1, "message": f"Could not find a software '{software}' by user '{user_id}'."}) | ||
json.dumps({"status": 1, "message": f"Could not find a software '{html.escape(software)}' by user '{html.escape(user_id)}'."}) | ||
) |
No description provided.