Skip to content

[WEB-10188] fix: cap outbound fetch response sizes - #10317

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10188-outbound-response-caps
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10188-outbound-response-caps

Conversation

@pablohashescobar

Copy link
Copy Markdown
Member

Description

Three outbound fetches read the whole response body with no size limit: the page-title fetch and the favicon fetch for work item links, and webhook delivery (whose response body is stored in the webhook log). The remote server therefore decided how much memory a Celery worker used and how much was stored.

  • New read_capped_body next to the pinned-fetch helpers: streams the response, stops at a byte cap or a time limit, and always closes it.
  • Link title HTML is read up to 1 MB and parsed up to that point. A favicon over 100 KB falls back to the default icon, as a failed fetch does.
  • Webhook delivery stores at most 10 KB of the response body, with a truncation marker.

SSRF validation is unchanged.

Behavior change:

  • The webhook log body is decoded as UTF-8 with replacement rather than by charset detection.
  • If the time limit passes mid-body, the webhook still counts as delivered and the partial body is logged.

Limits of this change: the time limit is checked between chunks, so a server that trickles bytes can still hold a read for a while, and the header phase is not covered. A hard bound needs Celery task time limits, which this codebase does not set. WebhookLog.response_headers is still stored whole.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New plane/tests/unit/bg_tasks/test_outbound_response_caps.py with the fetch mocked: an oversized page is not read in full, an oversized favicon is not stored, the webhook response is streamed and truncated, and normal responses behave as before. 6 passed; the oversized cases fail without the fix.
  • Suggested: add a work item link to a normal site and confirm title and favicon appear; fire a webhook at a test endpoint and confirm the log shows the response.

References

  • WEB-10188

Created with Claude Code

The work item link crawl (page title and favicon) and webhook delivery now
stream the response and stop at a byte cap and a time limit instead of
reading the whole body. An oversized favicon falls back to the default
icon, and the webhook log keeps only the start of the response body.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7bf6dc97-02b2-4563-bb20-fc7b7f71560d
Commits

Reviewing files that changed from the base of the PR and between 290383d and e030f3d.

Files selected for processing: 4

  • apps/api/plane/bgtasks/webhook_task.py
  • apps/api/plane/bgtasks/work_item_link_task.py
  • apps/api/plane/tests/unit/bg_tasks/test_outbound_response_caps.py
  • apps/api/plane/utils/url_security.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@pablohashescobar pablohashescobar changed the title [WEB-10188] fix(security): cap outbound fetch response sizes [WEB-10188] fix: cap outbound fetch response sizes Nov 16, 2026

@sriramveeraghanta sriramveeraghanta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Non-blocking: the time limit is only checked between chunks, and TestReadCappedBody patches time.monotonic for the whole process.

@sriramveeraghanta
sriramveeraghanta merged commit de898f1 into preview Nov 16, 2026
19 of 20 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10188-outbound-response-caps branch November 16, 2026 20:24
sriramveeraghanta pushed a commit that referenced this pull request Nov 16, 2026
The work item link crawl (page title and favicon) and webhook delivery now
stream the response and stop at a byte cap and a time limit instead of
reading the whole body. An oversized favicon falls back to the default
icon, and the webhook log keeps only the start of the response body.
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
The work item link crawl (page title and favicon) and webhook delivery now
stream the response and stop at a byte cap and a time limit instead of
reading the whole body. An oversized favicon falls back to the default
icon, and the webhook log keeps only the start of the response body.

(cherry picked from commit 99a6f23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants