Repository navigation
Comments: Keep the form nonce out of the page HTML - #53547
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
# Conflicts: # projects/packages/comments/src/form/class-comment-form.php
Proposed changes
window.JetpackComments, adds it to the form, so a bot posting the form's fields has none. It's inline rather than in the bundle so a reader whose bundle fails to load or parse can still post.loadevent, the inline script shows any form the bundle never mounted.Originfallback. Verbum never worked without JavaScript.jetpack_comments_email_has_accountand an email check.Originfallback must stay logged-in only, or a logged-out bot with no nonce gets in by sending a forgedOriginheader.Does this pull request change what data or activity we track or use?
jetpack_comments_email_has_accountno longer fires for logged-in readers. It only fired for them by mistake.Testing instructions
add_filter( 'jetpack_comments_new_hotness', '__return_true' );) and build the package.jetpack_comments_form_nonceinput. In DevTools, it has one.comments.jsbundle in DevTools (Network request blocking) and reload. The form still has the nonce input, and the plain form posts.curland without thejetpack_comments_form_noncefield. It's refused with "Sorry, this comment could not be posted."jetpack_comments_form_nonce=stale. It posts.badin DevTools and post again. It's refused.modalchunk and no email check request load.