Description
The assignment update endpoint uses eval() to convert string boolean values:
# src/quads/server/blueprints/assignments.py:538-539
if type(_value) is str:
if _value.lower() in ["true", "false"]:
value = eval(_value.lower().capitalize())
While currently constrained to "True" and "False", using eval() is inherently dangerous. A future code change expanding the match set could introduce remote code execution.
Affected Code
src/quads/server/blueprints/assignments.py:538-539 (update_assignment)
Recommended Fix
Replace with a safe mapping:
bool_map = {"true": True, "false": False}
if _value.lower() in bool_map:
value = bool_map[_value.lower()]
Description
The assignment update endpoint uses
eval()to convert string boolean values:While currently constrained to
"True"and"False", usingeval()is inherently dangerous. A future code change expanding the match set could introduce remote code execution.Affected Code
src/quads/server/blueprints/assignments.py:538-539(update_assignment)Recommended Fix
Replace with a safe mapping: