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.

Created at: Nov 5, 2025Updated at: Nov 5, 2025

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.

Affected Package

Affecting django-smart-ratelimit package, versions<0.3.2

Also affects

---

How to Fix

Upgradedjango-smart-ratelimitto0.3.2or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

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