-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default to POST form validation #4623
Default to POST form validation #4623
Conversation
One question, is there any risk to break plugins with this one? For example, if plugins perform a request to their own defined endpoints and depend on the default HTTP method. |
In principle some plugin could have added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@daniel-beck this has several approvals but it's marked as WiP and on hold? Does it need further work? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request template should be followed. This security hardening (IIUC) should definitely be present in the changelog and, if there is a risk of regressions, in the upgrade guidelines
Nope, as the endpoints would still handle GET requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combobox.jelly is missing a checkMethod
attribute, is this intended?
Otherwise the PR looks good!
@uhafner If it's supported internally, it's just a case of missing Jelly doc. Wouldn't be the first time. Will check when I have some time to work on this. |
@uhafner Thanks for the suggestion. It was in fact just missing Jelly doc, which I added. (Tested via UI Samples Plugin) |
Done, thanks for the explicit reminder. I removed it as this was really just for a PR build, as the comment stated. Now I think I'm feeling better about merging this even without all the pieces in place. |
@daniel-beck if you want this in then can you remove on-hold please? |
@timja Thanks for the reminder. I don't want this in 2.282, perhaps 2.283 just in case I forgot something. |
@daniel-beck do you want this in soon? |
@timja Thanks for the reminder. I removed the label. Thanks for the reviews everyone! |
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
You had actually predicted the future. I personally don't see much value here as those checks should not contain any sensitive information or configurable settings and only be used to validate things. There is the related issue: https://issues.jenkins.io/browse/JENKINS-65790 |
Maybe the solution isn’t to roll back this change but to look at the status code of the response and handle non-200 responses differently (e.g. by not blindly inserting the response into the DOM as HTML)? |
I attempted to do that in #5333 but based on the bug it isn't effective here. |
Debugging a bit, it seems here’s the part where the HTML is inserted:
Interestingly, the code already checks the response status but then decides to parse and add the HTML anyway, just hidden (with a toggle to let the user see it). Which won’t prevent the |
@sabberworm Nice find, could you submit a PR to fix this? |
Done, see #5601 |
I wonder whether this is worth an escape hatch? I don't think so given how frequent POST requests for these already are. Thoughts?
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeDesired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).