picoclaw/pkg
don 19835b2f60
fix(line): limit webhook request body size to prevent DoS (#1413)
* fix(line): limit webhook request body size to prevent DoS

Add io.LimitReader with 1 MB cap on the LINE webhook handler to prevent
unauthenticated memory exhaustion via oversized POST requests.

Follows the same pattern used in the WeCom channel (io.LimitReader).
Requests exceeding the limit are rejected with 413 Request Entity Too Large.

Fixes #1407

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(line): hoist body size const, add boundary tests

- Move maxWebhookBodySize to package-level const
- Add TestWebhookAcceptsMaxBodySize (exact limit → 403, not 413)
- Add TestWebhookRejectsOversizedBodyBeforeSignatureCheck
- Use const in test instead of magic number

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:55:40 +08:00
..
agent fix(agent): initialize MCP in direct agent mode (#1361) 2026-03-12 01:06:48 +08:00
auth feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
bus Removed the old heavy logic 2026-03-08 18:22:15 +01:00
channels fix(line): limit webhook request body size to prevent DoS (#1413) 2026-03-12 23:55:40 +08:00
commands feat: add /clear command to clear chat history (#1266) 2026-03-09 16:39:33 +08:00
config refactor: update model name and add VolcEngine coding plan (#1412) 2026-03-12 16:10:29 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron feat(cron): add execution lifecycle logging (#1185) 2026-03-06 20:46:52 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
health chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
heartbeat enable dupl check 2026-03-01 18:17:32 +11:00
identity feat(identity): add unified user identity with canonical platform:id format 2026-02-23 06:56:48 +08:00
logger refactor logger to zerolog (#1239) 2026-03-12 02:35:37 +08:00
mcp Feat/add tool enable or disable configuration (#1071) 2026-03-05 14:53:26 +08:00
media chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
memory fix: skip meta json files during session migration (#1340) 2026-03-11 14:29:42 +08:00
migrate docs: remove stale TOOLS.md references (#1388) 2026-03-12 09:47:01 +08:00
providers refactor: update model name and add VolcEngine coding plan (#1412) 2026-03-12 16:10:29 +08:00
routing fix(routing): address review feedback on CJK estimation and observability 2026-03-06 13:10:20 +08:00
session fix(security): harden unauthenticated tool-exec paths (#1360) 2026-03-11 19:22:20 +08:00
skills refactor skills loader markdown metadata parsing (#1354) 2026-03-11 18:08:00 +08:00
state fix(security): harden unauthenticated tool-exec paths (#1360) 2026-03-11 19:22:20 +08:00
tools fix(security): harden unauthenticated tool-exec paths (#1360) 2026-03-11 19:22:20 +08:00
utils Merge pull request #1207 from afjcjsbx/feat/debug-mode-no-truncate 2026-03-10 17:13:44 +01:00
voice Fix lint 2026-03-04 10:21:59 +00:00