Ratelimiting can be bypassed using IPv6 subnets
Nextcloud normalises IPv6 addresses to a single /128 address when applying brute-force throttling and rate limiting. An attacker who controls a large IPv6 subnet can rotate through many addresses to evade those protections.
- Triaged in 10 hours
- Fixed in 19 days
- Paid in 19 days
- Disclosed after 3 months
Nextcloud hardcodes IPv6 subnets to /128. End users get at least a /64 subnet (more than the whole IPv4 address space!), most providers assign even larger subnets like /48. The subnet is used to block bruteforce attempts [3] and rate limiting [4]. An attacker can easily generate random addresses from the assigned /48 subnet to bypass these protections. Nextcloud should block at least /64 subnets or even better dynamically change the size of the subnet depending on the amount of suspect requests coming from a larger subnet, maybe up to /32.
[1] https://github.com/nextcloud/server/blob/f12fab23db3529c34f620789f345f5e5e841c06a/lib/private/Security/Normalizer/IpAddress.php#L107-L110 [2] https://www.ripe.net/publications/docs/ripe-552#assignment [3] https://github.com/nextcloud/server/blob/f12fab23db3529c34f620789f345f5e5e841c06a/lib/private/Security/Bruteforce/Throttler.php#L132 [4] https://github.com/nextcloud/server/blob/f12fab23db3529c34f620789f345f5e5e841c06a/lib/private/Security/RateLimiting/Limiter.php#L84
Impact
bruteforce protection and rate limiting are basically useless for IPv6 targets.
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 address normaliser treats every IPv6 address as a single host (/128) instead of grouping addresses by the subnet the client actually controls.
Impact
Brute-force protection and rate limiting could be bypassed for IPv6 clients, making them effectively useless against an attacker with a large subnet.
What the attacker needed
Attacker controls an IPv6 subnet; target reachable over IPv6
The fix
Nextcloud should group IPv6 clients by at least a /64 subnet, or dynamically widen the grouping up to /32 when many suspect requests come from a larger subnet.
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.
Rate limiting slows down repeated attempts, such as guessing passwords, by counting requests from one source. Nextcloud counted each IPv6 address separately, but a single customer usually controls a huge block of IPv6 addresses, so an attacker could simply switch address for every attempt and never hit the limit.
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.