You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): redact PasswordInput-masked field values from detail payload (#504) (#522)
* fix(security): redact PasswordInput-masked field values from the detail payload (#504)
A CharField the admin routes through forms.PasswordInput (e.g. via
formfield_overrides) was serialized with its stored value intact, so a
secret kept on that field shipped as plaintext in the detail JSON — even
though Django's own admin renders PasswordInput with render_value=False
and never echoes the value back into the page.
Match Django's behaviour at the wire boundary: when the bound form
widget is a PasswordInput, redact `value` to null unless the admin opted
into render_value=True, and emit a `widget: "password"` hint. The SPA
renders a masked <input type="password"> (autoComplete="new-password")
for that hint. Read-only password fields also stop leaking, since the
value is redacted before FieldValueView renders it.
Also types the previously-untyped `widget` descriptor hint
(radio/raw_id/password) in the wire contract.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(form): cover the masked password input (#504)
The security contract: the backend redacts the value (it arrives null),
so the SPA never receives the secret — assert the input renders
type=password with autoComplete=new-password and stays empty, and that
typed characters propagate via onChange.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments