T05 · Unauthorized Access and Privilege Escalation
- Location
deploy-dolphindb.sh:166- Finding
Writable Host /etc Directory Exposed to the Container
- Content
View full analysis
Vulnerability Details
File Location:
deploy-dolphindb.sh:166-176
Vulnerability Type: Excessive host filesystem access through a writable Docker bind mount
Risk Level: CriticalVulnerable Code
bash docker run -itd \ --name "$CONTAINER_NAME" \ --hostname "$HOSTNAME" \ --platform "linux/$PLATFORM" \ -m "${MEMORY}g" \ -p 8848:8848 \ -p 8849:8849 \ -v /etc:/dolphindb/etc \ -v "$DATA_DIR:/data/ddb/server" \ "${IMAGE}:${VERSION}"Technical Analysis
The script bind-mounts the host's entire
/etcdirectory into the container. Docker bind mounts are writable unless explicitly marked read-only with:ro.The documentation states that this mount supports license fingerprint collection, but that purpose does not require writable access to every host configuration file. Under a standard rootful Docker configuration, a process running as root inside the container may write through
/dolphindb/etcto security-sensitive files on the host.This breaks the principle of least privilege and substantially increases the consequences of a compromised, malicious, or vulnerable DolphinDB image.
Attack Path
- An attacker compromises the selected container image, replaces a mutable image tag, or exploits the running DolphinDB service.
- Attacker-controlled code executes inside the container.
- The code accesses the host directory through
/dolphindb/etc. - Because the bind mount is writable, the code modifies host configuration files.
- The modified configuration may provide unauthorized host access or disrupt host security controls.
Impact Assessment
A successful attacker could potentially modify authentication, networking, service, or security configuration under the host's
/etcdirectory. The exact effect depends on host permissions, Docker user-namespace settings, and the files targeted, but a standard rootful Docker deployment may per ...[truncated 116 chars]- Remediation
View remediation
Remediation Suggestions
-
Do not mount the entire host
/etcdirectory. -
Identify the exact files required for license fingerprinting and mount only those files.
-
Mark every fingerprint-related mount read-only, for example:
bash -v /etc/machine-id:/dolphindb/etc/machine-id:ro -
Run the container as a dedicated non-root user where supported.
-
Enable Docker user-namespace remapping or use rootless Docker.
-
Add
--read-only,--cap-drop=ALL, and--security-opt=no-new-privileges:truewhere compatible. -
Document the specific host information exposed to the container and obtain explicit operator approval before mounting it.
-
