You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mounting volume can lead a compose stack to access to another compose stack volume, totally silently to the docker administrator. this can lead to accessing to data not allowed for the other stack.
(previous issue has been closed without any review on your part - #8250, so I hopened it again here, sorry for the inconveniance, but I don't understand why it is not processed has this is an easily reproductible problem with information I gave. Thanks.).
docker exec my-project_myservice_2 ls /mydatas
Secret file is visible by the second project!
Observed result
We can only see myproject_myvolume which is used by both stack.
The same volume is mounted on both stack. my-project has access to the file created for myproject.
my-project use volume myproject_myvolume, but it should be my-project_myvolume which should have been created.
If the stack my-project is runned first my-project_myvolume is well created.
How to check:
docker-compose -f compose.yml -p my-project down
docker-compose -f compose.yml -p myproject down
docker volume rm myproject_myvolume
docker-compose -f compose.yml -p my-project up -d
docker volume ls
We can see my-project_myvolume has been created, here the name is good.
Expected result
It is esxpect that myproject_myvolume and my-project_myvolume are created when i first start the stack myproject and after the stack my-project. Behavious and volume name must not differ depending order of runned composer up commands.
Stacktrace / full error message
N/A
Additional information
I already created some times ago an issue to report the problem but it never get attention (#6904), so I closed this one, hoping this new one will be studied.
I hope it could be fixed as it leads to security concern and strange behaviour in case projet name differs from only a dash and the one without dash is started first.
For pratical use case, we encounter serious problem with project having just a name like "myproject" and the other one "my-project" and the volume was database, leading to the project "my-prject" to use the "myproject" database... pretty hard bug. Hopefully it was in testing environment, but for production environment it could be desastrous.
A malicious user could use this tricky behaviour to access data of another stack.
Tested on Debian buster, official repositories, all up to date, including docker and docker compose.
Thanks!
The text was updated successfully, but these errors were encountered:
Project name explicitly set by user using --project-name is actually converted to remove some characters, but should have been rejected. This triggers resource naming conflicts, that I would not classify as "security issue" but definitively an usability issue we have to address.
I tried to reproduce with your scenario, and I get distinct volume created depending on project name: docker-compose -f compose.yml -p my-project up => my-project_myvolume docker-compose -f compose.yml -p myproject up => myproject_myvolume
so, collision doesn't occur.
did I miss something?
Description of the issue
Mounting volume can lead a compose stack to access to another compose stack volume, totally silently to the docker administrator. this can lead to accessing to data not allowed for the other stack.
(previous issue has been closed without any review on your part - #8250, so I hopened it again here, sorry for the inconveniance, but I don't understand why it is not processed has this is an easily reproductible problem with information I gave. Thanks.).
Context information (for bug reports)
Output of
docker-compose version
Output of
docker version
Output of
docker-compose config
(Make sure to add the relevant
-f
and other flags)Steps to reproduce the issue
Order is very important here, myproject should be started before my-project.
Secret file is visible by the second project!
Observed result
We can only see
myproject_myvolume
which is used by both stack.The same volume is mounted on both stack. my-project has access to the file created for myproject.
my-project use volume
myproject_myvolume
, but it should bemy-project_myvolume
which should have been created.If the stack my-project is runned first
my-project_myvolume
is well created.How to check:
We can see
my-project_myvolume
has been created, here the name is good.Expected result
It is esxpect that
myproject_myvolume
andmy-project_myvolume
are created when i first start the stackmyproject
and after the stackmy-project
. Behavious and volume name must not differ depending order of runned composer up commands.Stacktrace / full error message
N/A
Additional information
I already created some times ago an issue to report the problem but it never get attention (#6904), so I closed this one, hoping this new one will be studied.
I hope it could be fixed as it leads to security concern and strange behaviour in case projet name differs from only a dash and the one without dash is started first.
For pratical use case, we encounter serious problem with project having just a name like "myproject" and the other one "my-project" and the volume was database, leading to the project "my-prject" to use the "myproject" database... pretty hard bug. Hopefully it was in testing environment, but for production environment it could be desastrous.
A malicious user could use this tricky behaviour to access data of another stack.
Tested on Debian buster, official repositories, all up to date, including docker and docker compose.
Thanks!
The text was updated successfully, but these errors were encountered: