PyPI: django-smart-ratelimit
SFTY-20250709-10157
Safety legacy ID: pyup.io-77960
Affected versions of the django-smart-ratelimit package are vulnerable to a Race Condition leading to Rate Limit Bypass. In the fixed-window backend, the counter.count += 1 followed by counter.save() is not atomic, so concurrent requests can overwrite each other’s increments. In the sliding-window backend, the delete/create steps are not wrapped in a transaction.atomic(), allowing inconsistent state under load.
Overview
Affected versions of the django-smart-ratelimit package are vulnerable to a Race Condition leading to Rate Limit Bypass. In the fixed-window backend, the counter.count += 1 followed by counter.save() is not atomic, so concurrent requests can overwrite each other’s increments. In the sliding-window backend, the delete/create steps are not wrapped in a transaction.atomic(), allowing inconsistent state under load.
Advisory
Affected versions of the django-smart-ratelimit package are vulnerable to a Race Condition leading to Rate Limit Bypass. In the fixed-window backend, the counter.count += 1 followed by counter.save() is not atomic, so concurrent requests can overwrite each other’s increments. In the sliding-window backend, the delete/create steps are not wrapped in a transaction.atomic(), allowing inconsistent state under load.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more