Repository navigation
fix(functions): reject control characters in execution header values - #15143
Conversation
Header values are forwarded as request headers to the runtime, so they must be single-line. The executor client also drops any header that would span lines.
|
Review complete. No blocking issues — approved ✅; 2 nitpicks below. 🧹 Nitpicks (2) — 🟢 2 low
This PR hardens function execution against header injection: user- or config-supplied headers are validated for control characters before reaching runtimes, with a second denylist filter in the executor for defense in depth, plus unit tests for the new validator.
Reviewed commit: e2c8523 |
🟢 Tier S · Ready to merge
Function execution header values are restricted to single-line content, with horizontal tabs still allowed, and unsafe headers are filtered before forwarding to the runtime. Unit tests cover rejected control characters and the permitted tab case. Latest changes: The newest commits replace the regex checks with
📂 Walkthrough · 3
Reviewed the commits since |
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
Follows the repo rule against new preg_* calls.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Execution header values are forwarded to the runtime as request headers, so they should be single-line.
Executor::createExecution()also drops any header whose name or value contains CR, LF or NUL before forwarding.Tests: new cases in
tests/unit/Functions/Validator/HeadersTest.php(fail without the validator change).Related: appwrite-labs/cloud#6673