Review main Merged

62000[BUGFIX] Disable browser autofill feature for the honeypot field

Christian Eßl CR +2 V +2 Easy +2 −2 updated 11/22/19, 15:37

Commit message

Use the form element name for the autocomplete html attribute
for honeypot fields to prevent browsers "autofill" feature
to fill the honeypot field.

Review

  • Code review CR +2 Done
    • Ralf Zimmermann +2
    • Björn Jacob +1
    • Mathias Brodala +1
  • Verified V +2 Done
    • Ralf Zimmermann +2
    • Martin Schöne +1
    • Björn Jacob +1
    • Mathias Brodala +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1924

  1. Christian Eßl uploaded patch set 1 10/15/19, 12:09

  2. TYPO3com voted on patch set 1 V -1 10/15/19, 12:19 Completed build in 09m 50s on Tue, 15 Oct, 12:19 PM Test Summary: 1 of 48094 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37335

  3. TYPO3com voted on patch set 1 V +1 10/15/19, 12:25 Completed build in 25m 54s on Tue, 15 Oct, 12:25 PM Test Summary: 47982 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37335

  4. Mathias Brodala commented on patch set 1 10/15/19, 12:47

    I fully understand the purpose of this change, however this would make it even harder for humans to submit forms using autofill, see https://bugs.chromium.org/p/chromium/issues/detail?id=132135 Right now when I unintentionally fill the honeypot field, I can simply submit the form again to get it working. With this change I'd now need to inspect the DOM or run a script to find and clear the honeypot field.
  5. Christian Eßl commented on patch set 1 10/15/19, 12:54

    > Patch Set 1: > > I fully understand the purpose of this change, however this would make it even harder for humans to submit forms using autofill, see https://bugs.chromium.org/p/chromium/issues/detail?id=132135 > > Right now when I unintentionally fill the honeypot field, I can simply submit the form again to get it working. With this change I'd now need to inspect the DOM or run a script to find and clear the honeypot field. Is this a problem right now with ext:form? All generated honeypot fields should already have the attribute autocomplete="off" to prevent this from happening.
  6. Mathias Brodala commented on patch set 1 10/15/19, 12:57

    > Is this a problem right now with ext:form? All generated honeypot fields should already have the attribute autocomplete="off" to prevent this from happening. See the linked issue: 1. autocomplete="off" gives a hint to spam bots that they should handle this field in a special way 2. Chrome seems to ignore this
  7. Ralf Zimmermann uploaded patch set 2 11/22/19, 09:15

  8. Ralf Zimmermann updated the commit message in patch set 3 11/22/19, 09:16

  9. Ralf Zimmermann commented on patch set 3 11/22/19, 09:29

    You can thest this like this * add an address autofill profile -> https://support.google.com/chrome/answer/142893 * use a form definition like this renderingOptions: submitButtonLabel: Submit type: Form identifier: xxx label: xxx prototypeName: standard renderables: - renderingOptions: previousButtonLabel: 'Previous step' nextButtonLabel: 'Next step' type: Page identifier: page-1 label: Step renderables: - defaultValue: '' type: Text identifier: name label: Text - defaultValue: '' validators: - identifier: EmailAddress type: Email identifier: email-1 label: 'Email address' - defaultValue: '' properties: fluidAdditionalAttributes: min: '' max: '' step: 1 type: Date identifier: date-1 label: Date - defaultValue: '' type: Text identifier: street label: Text * Edit typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html * Replace <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="{element.properties.styleAttribute}" /> with <f:form.textfield property="x5QNMogzIPF8ntqw2V" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="" /> to see the honeypot field (remove the style attribute). x5QNMogzIPF8ntqw2V is an pattern within the name attribute which let chrome identify this field as the "Zip" field. * now the honeypot field should be filled with the value from "Zip" from your autofill profile if you klick within the name field and select your profile "Name". * Edit typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html * Replace <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="{element.properties.styleAttribute}" /> with <f:form.textfield property="x5QNMogzIPF8ntqw2V" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'new-password', aria-hidden: 'true'}" tabindex="-1" style="" /> * now the honeypot field should be not be filled with the value from "Zip" from your autofill profile if you klick within the name field and select your profile "Name".
  10. TYPO3com voted on patch set 2 V +1 11/22/19, 09:36 Completed build in 15m 00s on Fri, 22 Nov, 09:36 AM Test Summary: 48085 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38589

  11. TYPO3com voted on patch set 3 V +1 11/22/19, 09:39 Completed build in 17m 56s on Fri, 22 Nov, 09:39 AM Test Summary: 48085 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38590

  12. Mathias Brodala commented on patch set 3 11/22/19, 10:16

    Honeypot.html:4 Unresolved

    I fear that this will lead to this field being filled with a newly generated password. Right now Chrome does not do this since it does not have the ability to generate passwords. Yet. But other password managers and their browser integrations could do this now or in the future. So maybe we could use a bogus "autocomplete" value instead ...
  13. Oli Bartsch updated the commit message in patch set 4 11/22/19, 10:55

  14. Ralf Zimmermann commented on patch set 5 11/22/19, 10:57

    Published edit on patch set 4.
  15. Ralf Zimmermann updated the commit message in patch set 6 11/22/19, 11:00

  16. Ralf Zimmermann commented on patch set 6 11/22/19, 11:08

    You can thest this like this * add an address autofill profile -> https://support.google.com/chrome/answer/142893 * use a form definition like this renderingOptions: submitButtonLabel: Submit type: Form identifier: xxx label: xxx prototypeName: standard renderables: - renderingOptions: previousButtonLabel: 'Previous step' nextButtonLabel: 'Next step' type: Page identifier: page-1 label: Step renderables: - defaultValue: '' type: Text identifier: name label: Text - defaultValue: '' validators: - identifier: EmailAddress type: Email identifier: email-1 label: 'Email address' - defaultValue: '' properties: fluidAdditionalAttributes: min: '' max: '' step: 1 type: Date identifier: date-1 label: Date - defaultValue: '' type: Text identifier: street label: Text * Edit typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html * Replace <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="{element.properties.styleAttribute}" /> with <f:form.textfield property="x5QNMogzIPF8ntqw2V" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="" /> to see the honeypot field (remove the style attribute). x5QNMogzIPF8ntqw2V is an pattern within the name attribute which let chrome identify this field as the "Zip" field. * now the honeypot field should be filled with the value from "Zip" from your autofill profile if you klick within the name field and select your profile "Name". * Edit typo3/sysext/form/Resources/Private/Frontend/Partials/Honeypot.html * Replace <f:form.textfield property="{element.identifier}" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: 'off', aria-hidden: 'true'}" tabindex="-1" style="{element.properties.styleAttribute}" /> with <f:form.textfield property="x5QNMogzIPF8ntqw2V" id="{element.uniqueIdentifier}" class="{element.properties.elementClassAttribute}" additionalAttributes="{autocomplete: element.identifier, aria-hidden: 'true'}" tabindex="-1" style="" /> * now the honeypot field should be not be filled with the value from "Zip" from your autofill profile if you klick within the name field and select your profile "Name".
  17. TYPO3com voted on patch set 6 V +1 11/22/19, 11:10 Completed build in 09m 57s on Fri, 22 Nov, 11:10 AM Test Summary: 48085 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38609

  18. Mathias Brodala voted on patch set 6 CR +1 11/22/19, 13:38

  19. Björn Jacob voted on patch set 6 CR +1 11/22/19, 14:40

  20. Björn Jacob voted on patch set 6 V +1 11/22/19, 14:44

  21. Mathias Brodala commented on patch set 6 V +1 11/22/19, 14:45

    Tested with runtime manipulation of an arbitrary form using the Elements tab of Chromes dev tools.
  22. Ralf Zimmermann voted on patch set 6 V +2 CR +2 11/22/19, 14:59

  23. Ralf Zimmermann merged patch set 7 11/22/19, 14:59

  24. Martin Schöne voted on patch set 7 V +1 11/22/19, 15:37