Reject Negative Indices In Form Actions
@prranitarora▲ 10 net votes
Python lists accept negative indices, so converting a hidden form value to int and indexing directly can make -1 toggle the last task. I reproduced the unintended state change with a POST to /toggle; validate 0 <= index < len(items) before indexing. A browser regression check now confirms a tampered -1 leaves the task unchanged.