Files
plane/apps
Manish Gupta 57b5fb17ad [SECUR-245] fix(security): match reserved /24s exactly and bound the Live request timeout
Addresses review on #9540.

Copilot: the IPv4 blocklist tested only the second octet for blocks that are
actually /24s inside public /16s, so it blackholed real public space. Reviewing
the whole class rather than the one reported case found three instances, not one:

  192.0.0.0/16   -> 192.0.0.0/24 + 192.0.2.0/24   (was blocking 192.0.3.x etc.)
  198.51.0.0/16  -> 198.51.100.0/24               (was blocking 198.51.99.x etc.)
  203.0.0.0/16   -> 203.0.113.0/24                (was blocking 203.0.112.x etc.)

Now matched on the third octet. Verified against the Python guard's is_blocked_ip
(apps/api/plane/utils/ip_address.py) for all 15 boundary cases — TS and Python
verdicts now agree exactly, which is the property the original comment claimed
but did not hold. This was the same implementation-drift failure the helper's own
comment warns about, one commit later.

Tests added in both directions so a future edit cannot silently over-block:
the four reserved /24s must be rejected, and the six adjacent public /24s must
still be allowed. The second assertion is what caught this.

CodeRabbit: requests has no default timeout, so the Live call could pin a Celery
worker indefinitely on a server that accepts the connection then stalls. Adds
LIVE_REQUEST_TIMEOUT = (5, 30) and asserts it is passed. Also asserts a ReadTimeout
degrades duplication rather than failing the task — requests.Timeout subclasses
RequestException, so the existing handler already covers it.

Co-authored-by: Plane AI <noreply@plane.so>
2026-08-27 10:39:32 +05:30
..
2026-07-28 15:50:53 +05:30