something evi...">

Removed input value from deault_error_message by chickahoona · Pull Request #5881 · encode/django-rest-framework (original) (raw)

chickahoona

Its never a good idea to return the provided input in an error message, as it can easily result in an reflected XSS. Imagine someone sends a form with a field like "", you return the value in the error message as it does not pass your serializer and the frontend may not sanitize it proper, as it trusts its own backend. :)

@chickahoona

Its never a good idea to return the provided input in an error message, as it can easily result in an reflected XSS. Imagine someone provides sends a form with a field like "", you return the value and the frontend may not sanitize it proper, as it trusts its own backend. :)

@tomchristie

Looks like there are some tests that’d need updating too. I’d prefer the form “Must be a ...” for the wording.

Signed-off-by: Sascha Pfeiffer sascha.pfeiffer@psono.com

@chickahoona

Thanks for the ping. Should pass now. I didnt get the "Must be a ... for the wording" thing.

Signed-off-by: Sascha Pfeiffer sascha.pfeiffer@psono.com

@tomchristie

I meant we should use phrasing “Must be a valid boolean” instead of “Is not a valid boolean.”

@carltongibson

@chickahoona chickahoona deleted the remove-input-value-from-error-message branch

April 20, 2018 15:40

shanemcd pushed a commit to shanemcd/awx that referenced this pull request

Jun 18, 2019

@jbradberry @shanemcd

pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request

Nov 17, 2020

@chickahoona