Autocomplete security improvement #11737
Replies: 2 comments 2 replies
-
Sounds reasonable to me, you could PR that? |
Beta Was this translation helpful? Give feedback.
1 reply
-
If a missing But I don't think we need to worry about the logged in/out logic. For example, if I'm on a form where its asking for my name, it would be nice for my browser to suggest my name whether I'm logged in or out. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using the template resources/views/vendor/statamic/forms/fields/default.antlers.html, to avoid the browser warning about the missing autocomplete attribute for input fields and to prevent it from saving confidential data when the user is not logged in, I (suggest to) modify the line {{ autocomplete ?= 'autocomplete="{autocomplete}"' }} as in example below. What you think about this? Don't you think this should happen by default?
Why this matters
Privacy & Security: Prevents browsers from saving or suggesting sensitive form input values for non-authenticated users. This is especially relevant for public/guest forms.
Accessibility compliance: Avoids browser console warnings about missing autocomplete attributes.
Developer friendly: Still allows developers to explicitly set autocomplete, and respects that setting — but only for authenticated users.
Result
Logged-in users: can benefit from developer-defined autocomplete values.
Logged-out users: autocomplete is safely disabled (autocomplete="off"), reducing autofill risks.
Beta Was this translation helpful? Give feedback.
All reactions