You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "marcusschiesser (via GitHub)" <gi...@apache.org> on 2026/04/13 09:07:10 UTC
[PR] fix: Escape directory labels in DefaultServlet HTML listings [tomcat]
marcusschiesser opened a new pull request, #988:
URL: https://github.com/apache/tomcat/pull/988
## Summary
Escape the current directory label and parent label in `DefaultServlet` HTML directory listings.
This fixes a stored XSS issue in shared-hosting or otherwise untrusted-content deployments where directory listings are enabled and an attacker can influence listed directory names.
## Attack scenario
1. An untrusted content publisher can create directories under a served path.
2. Directory listings are enabled for that shared content root.
3. The attacker creates a directory named `<img src=x onerror=fetch('/manager/text/list',{credentials:'include'})>`.
4. An operator browses the listing page to inspect uploaded content.
5. Tomcat renders the directory name unescaped in the generated listing page.
6. The browser executes the injected JavaScript in the origin of that site.
## Changes
- escape the current directory label in the generated listing title and heading
- escape the parent directory label in the generated listing breadcrumb
- add a regression test for malicious directory labels in `TestDefaultServlet`
## Verification
- `ant test-compile test-only -Dtest.entry=org.apache.catalina.servlets.TestDefaultServlet`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] fix: Escape directory labels in DefaultServlet HTML listings [tomcat]
Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher closed pull request #988: fix: Escape directory labels in DefaultServlet HTML listings
URL: https://github.com/apache/tomcat/pull/988
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] fix: Escape directory labels in DefaultServlet HTML listings [tomcat]
Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher commented on PR #988:
URL: https://github.com/apache/tomcat/pull/988#issuecomment-4235252652
If you can modify the webapp resources, you can already send compromised content to the user. As a result filtering was not added to these.
Note: security concerns should always be discussed on the security mailing list
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org