# GHSA-VFMQ-R373-X89F: Race in docker cp lets a container write through read-only bind mounts

- Database: GitHub
- Severity: CVSS 4.1 (Medium)
- Published: 2026-11-24
- Modified: 2026-11-25

## Tracked as

- [CVE-2026-135124](https://cve.now/CVE-2026-135124.md): Docker race condition in container copy bypasses read-only mounts

## Affected versions

- github.com/moby/moby/v2/daemon (Go): through 2.0.0-beta.31

## Description

## Summary

A race condition during `docker cp` mount setup allows a malicious container to leave a read-only bind mount writable while an archive is extracted into the container, potentially modifying host files that were meant to be protected.

When copying files into a container, the daemon bind-mounts the container's volumes into a temporary view and applies the read-only flags afterwards, through a path inside the container's filesystem.
A process in the container can change that path in between, so the flags land on a different mount and the intended bind mount stays writable for the duration of the copy.

## Conditions for exploitation

- The container has at least one read-only bind mount.
- A process inside the running container can modify a path leading to that mount's destination.
- An operator or API client copies files into that container with `docker cp` or `PUT /containers/{id}/archive`.

### Not affected

- Containers without read-only bind mounts.
- Stopped containers, because no container process can interfere during the copy.
- Copies out of a container, such as `GET` and `HEAD` on `/containers/{id}/archive`, because they do not write to the mounts.

Rootless Docker Engine is affected, but the impact is limited to files accessible to the daemon's user.

## Impact

A malicious container can make a read-only bind mount writable while a `docker cp` into it is running.
The archive being copied can then create or overwrite files in the host directory behind the mount.

- The attacker does not choose the content written. It comes from the archive supplied by whoever runs the copy.
- The attacker cannot start the copy. An operator or API client has to do it.
- The mount is temporary, but files written through it persist after the copy completes.

## Workarounds

- Do not copy files into running containers that run untrusted workloads.
- Stop the container before copying files into it.
- Use authorization plugins to restrict access to `PUT /containers/{id}/archive`.

## Credits

This issue was reported by Jaeyeong Lee

## References

- https://github.com/moby/moby/security/advisories/GHSA-vfmq-r373-x89f

Page: https://cve.now/GHSA-VFMQ-R373-X89F

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
