Teach loadinfo if navigation was form-submission
Categories
(Core :: DOM: Security, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: ckerschb, Assigned: beriksson)
References
Details
(Whiteboard: [domsecurity-active])
Attachments
(1 file)
The code within HTMLFormSubmission [1] needs to pass the CSP so navigate-to can query it within the docshell.
[1] https://searchfox.org/mozilla-central/source/dom/html/HTMLFormElement.cpp#703
Reporter | ||
Comment 1•5 years ago
|
||
Hey Nika, when implementing CSP 'navigate-to', we need to discard the 'navigate-to' directive in case 'form-action' is set. To do that we would need to know whether a docshell load originated from a form submission. I looked through docshell code and couldn't find anything. I would suggest we extend OnLinkClickSync() [1] by an additional boolean argument indicating the load originated from a form submission here [2].
Would you agree to that or is there a better alternative already available within docshell which allows us to query whether a load originated from a form submission?
[1] https://searchfox.org/mozilla-central/source/docshell/base/nsDocShell.h#264
[2] https://searchfox.org/mozilla-central/source/dom/html/HTMLFormElement.cpp#703
Comment 2•5 years ago
|
||
That sounds plausible, but I'm going to 302 :bz this one.
Comment 3•5 years ago
|
||
OnLinkClickSync
can just examine aContent->IsHTMLElement(nsGkAtoms::form)
to determine whether we're doing a form submission, right?
You presumably need to add the "is a form submission state" to LoadInfo
so you can implement https://w3c.github.io/webappsec-csp/#navigate-to-navigation-response correctly, so will need to add it to nsDocShellLoadState
or something. But you don't need a new argument on OnLinkClickSync
, afaict.
Comment 4•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
The flag in loadinfo can be used to detect if a load was initiated by a form submission. This is crucial for implmenting the CSP directive navigate-to. https://www.w3.org/TR/CSP3/#navigate-to-pre-navigate
Assignee | ||
Updated•5 years ago
|
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dec63fb72f14
Added flag to detect if a load was initiated by a form submission r=ckerschb
Comment 7•5 years ago
|
||
bugherder |
Description
•