| 1 |
========================================= |
| 2 |
CELERYSA-0002: Celery Security Advisory |
| 3 |
========================================= |
| 4 |
:contact: [email protected] |
| 5 |
:CVE id: TBA |
| 6 |
:date: 2014-07-10 05:00:00 p.m. UTC |
| 7 |
|
| 8 |
Details |
| 9 |
======= |
| 10 |
|
| 11 |
:package: celery |
| 12 |
:vulnerability: Environment error |
| 13 |
:problem type: local |
| 14 |
:risk: low |
| 15 |
:versions-affected: 2.5, 3.0, 3.1 |
| 16 |
|
| 17 |
Description |
| 18 |
=========== |
| 19 |
|
| 20 |
The built-in utility used to daemonize the Celery worker service sets |
| 21 |
an insecure umask by default (umask 0). |
| 22 |
|
| 23 |
This means that any files or directories created by the worker will |
| 24 |
end up having world-writable permissions. |
| 25 |
|
| 26 |
In practice this means that local users will be able to modify and possibly |
| 27 |
corrupt the files created by user tasks. |
| 28 |
|
| 29 |
This isn't immediately exploitable but can be if those files are later |
| 30 |
evaluated as a program, for example a task that creates Python program files |
| 31 |
that are later executed. |
| 32 |
|
| 33 |
Patches are now available for all maintained versions (see below), |
| 34 |
and users are urged to upgrade, even if not directly |
| 35 |
affected. |
| 36 |
|
| 37 |
Acknowledgments |
| 38 |
=============== |
| 39 |
|
| 40 |
Special thanks to Red Hat for originally discovering and reporting the issue. |
| 41 |
|
| 42 |
Systems affected |
| 43 |
================ |
| 44 |
|
| 45 |
Users of Celery versions 3.0, and 3.1, except the recently |
| 46 |
released 3.1.13, are affected if daemonizing the |
| 47 |
Celery programs using the `--detach` argument or using the `celery multi` program |
| 48 |
to start workers in the background, without setting a custom `--umask` |
| 49 |
argument. |
| 50 |
|
| 51 |
Solution |
| 52 |
======== |
| 53 |
|
| 54 |
NOTE: |
| 55 |
Not all users of Celery will use it to create files, but if you do |
| 56 |
then files may already have been created with insecure permissions. |
| 57 |
|
| 58 |
So after upgrading, or using the workaround, then please make sure |
| 59 |
that files already created aren't world writable. |
| 60 |
|
| 61 |
To work around the issue you can set a custom umask using the ``--umask`` |
| 62 |
argument: |
| 63 |
|
| 64 |
$ celery worker -l info --detach --umask=18 # (022) |
| 65 |
|
| 66 |
Or you can upgrade to a more recent version: |
| 67 |
|
| 68 |
- Users of the 3.1 series should upgrade to 3.1.13: |
| 69 |
|
| 70 |
* ``pip install -U celery``, or |
| 71 |
* ``easy_install -U celery``, or |
| 72 |
* https://pypi.org/project/celery/3.1.13/ |
| 73 |
|
| 74 |
- Users of the 3.0 series should upgrade to 3.0.25: |
| 75 |
|
| 76 |
* ``pip install -U celery==3.0.25``, or |
| 77 |
* ``easy_install -U celery==3.0.25``, or |
| 78 |
* https://pypi.org/project/celery/3.0.25/ |
| 79 |
|
| 80 |
Distribution package maintainers are urged to provide their users |
| 81 |
with updated packages. |
| 82 |
|
| 83 |
Please direct questions to the celery-users mailing-list: |
| 84 |
https://groups.google.com/group/celery-users/, |
| 85 |
|
| 86 |
or if you're planning to report a new security related issue we request that |
| 87 |
you keep the information confidential by contacting |
| 88 |
[email protected] instead. |
| 89 |
|
| 90 |
Thank you! |