CVE-2022-51020: Flower before 2.2.0 CSRF via Worker and Task Control API Endpoints
Flower before 2.2.0 contains a cross-site request forgery vulnerability because Tornado xsrfcookies is disabled and the OAuth session cookie lacks SameSite. Attackers can lure authenticated users to malicious pages that POST to /api/worker/shutdown, /api/worker/pool/restart, or /api/task/revoke to shut down Celery workers, resize pools, and revoke tasks.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Flowerto a version that resolves this vulnerability.Fixed in 2.2.0
Event History
Frequently Asked Questions
Does an attacker need their own Flower account to exploit this issue?
The described attack relies on luring an authenticated user to a malicious page. The attacker does not need to be authenticated if they can cause an authenticated user's browser to submit the request.
Which actions can an attacker cause through the affected interface?
Requests can target worker shutdown, worker pool restart, and task revocation endpoints. This can shut down Celery workers, resize or restart pools, and revoke tasks.
What browser-side conditions make the attack possible?
Affected versions have Tornado XSRF cookies disabled, and the OAuth session cookie lacks a SameSite attribute. These conditions allow a malicious site to induce cross-site POST requests from an authenticated user's browser.