Memcached used as RateLimiter backend is no-op
With Memcached as rate limiter backend, actions that partly reset a cache entry wipe rate limit attempts, weakening brute-force protection.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 42 days
- Disclosed after 3 months
Summary by the program
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-xmhp-7vr4-hp63
The report
Summary:
When Memcached is used as backend: https://github.com/nextcloud/server/blob/c705b8fcb3de7910e67cd2ed2d2b38653f58962a/lib/private/Server.php#L787-L799
The following code block is problematic: https://github.com/nextcloud/server/blob/90104bc1c448c6da2fd3e052fca75bb3fb261c87/lib/private/Memcache/Memcached.php#L135-L139
I guess we need to check the actual cache type and use the DB backend when Memcached is used?
Impact
Any action that partly resets any cache entry will wipe rate limit attempts and future bruteforce protection (with https://github.com/nextcloud/server/pull/39870 )
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Memcached cache implementation does not properly support the increment operation used by the rate limiter, so attempts are not counted.
Impact
Brute-force protection could be weakened because rate limit attempts are wiped.
What the attacker needed
Memcached configured as cache backend
The fix
The rate limiter should check the actual cache type and use a database backend when Memcached is in use.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Here, the counting was broken when Memcached was used: actions that partly reset a cache entry wiped the attempts, so protection was weakened.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.