-
Notifications
You must be signed in to change notification settings - Fork 338
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
URL encoding issue in test report links with square brackets #659
Comments
Did you also change JUnit versions at all or just Jenkins core versions? |
cc @daniel-beck / @Wadeck in case you are aware of a security change that might have affected this? |
I typically update all plugins available for update after a Jenkins core update or upgrade, so I don’t recall the exact timing of my last JUnit plugin update. However, I’m currently using the latest version, and the previous version listed next to the downgrade button is 1300.v03d9d8a_cf1fb_. As a side note, I'm fairly certain I updated all available plugins on or after October 17th. Therefore, it seems that I haven’t updated the JUnit plugin recently, as all previous JUnit releases are over a month old (ref. JUnit plugin releases). |
Likely a side effect of jenkinsci/jenkins#9590, as Jetty 12 is more strict than Jetty 10 was about such URLs. See related discussion in the subtasks of JENKINS-73120. If the plugin is working when the links are URL-encoded, then I think the most practical option would be to simply generate URL-encoded links in the first place rather than the current (broken) links. |
Do you know which one specifically? There's a lot of subtasks |
JENKINS-73128 and JENKINS-73129 in particular, which resulted in changes to some tests in jenkinsci/jenkins#9590. The long and short of it is that the newer servlet specification is more strict than earlier versions about rejecting suspicious URLs, and newer versions of Jetty comply. The security team was generally positive about this increased level of protection, but this is the first case we have heard of where it is negatively impacting users. But it sounds like if we just generate URL-encoded links then this problem should be solvable. |
URL-encoding links to tests as in #660 seems to fix it 🤷 |
Nope sorry. The hypothesis from Basil seems convincing to me 👍 |
Fixed in #660. Released in 1308.vb_90591b_eb_996. |
see #660 (comment) |
I released 1309.v0078b_fecd6ed using |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
After upgrading Jenkins from version 2.462.3 to 2.479.1, all test result/report links containing square brackets ([ and ]) in the URL now fail with the following error:
URI: /badURI
STATUS: 400
MESSAGE: Illegal Path Character
However, if the square brackets are manually replaced with percent encodings (%5B for [ and %5D for ]), the links work correctly.
Reproduction steps
Access test results/reports via link:
https://<jenkins_url>/job/<job_name>/<build_number>/testReport/(root)/[RESULTS]
Expected Results
Convert link to this:
https://<jenkins_url>/job/<job_name>/<build_number>/testReport/(root)/%5BRESULTS%5D
Actual Results
HTTP ERROR 400 Illegal Path Character
URI: /badURI
STATUS: 400
MESSAGE: Illegal Path Character
Powered by Jetty:// 12.0.13
Anything else?
No response
Are you interested in contributing a fix?
No response
The text was updated successfully, but these errors were encountered: