fix(security): prod recipe keeps resolve_remote false; fix allowlist docs - #32
Conversation
📝 WalkthroughWalkthroughThe PR updates security documentation for remote image resolution. It states that an empty ChangesSecurity allowlist guidance
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/SECURITY.md`:
- Line 52: Update the ImageResolver timeout statement in the security
documentation to describe 10 seconds as the default used when no
images.remote_timeout setting is provided, not as an enforced limit. Preserve
the surrounding mitigation guidance and avoid implying a maximum timeout.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a1797995-44b4-439e-b4e9-f4d6cc9f25f8
⛔ Files ignored due to path filters (1)
.symfony/recipe/nowo-tech/html-to-word-bundle/1.0/config/packages/nowo_html_to_word.yamlis excluded by none and included by none
📒 Files selected for processing (2)
docs/SECURITY.mddocs/UPGRADING.md
|
|
||
| - **Risk**: When `images.resolve_remote` is true, `file_get_contents()` may fetch attacker-controlled URLs from the server network. | ||
| - **Mitigation**: Keep remote resolution **disabled** in sensitive deployments; terminate outbound traffic at the network layer; prefer base64 or controlled CDN URLs at the application layer. HTTP timeouts are limited (10s) in `ImageResolver`. | ||
| - **Mitigation**: Keep remote resolution **disabled** (recipe default and `when@prod: resolve_remote: false`). `RemoteImageHostPolicy` **denies** remote hosts when `remote_host_allowlist` is empty — configure an explicit allowlist before enabling remote. Terminate outbound traffic at the network layer; prefer base64 or controlled CDN URLs at the application layer. HTTP timeouts are limited (10s) in `ImageResolver`. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Describe 10 seconds as the default timeout, not a limit.
ImageResolver reads images.remote_timeout and uses 10.0 only when the setting is absent. The code enforces a minimum of 0.1 seconds, but it does not enforce a maximum of 10 seconds. Update this sentence to avoid misleading operators.
Proposed wording
-- HTTP timeouts are limited (10s) in `ImageResolver`.
+- HTTP timeouts default to 10s and can be configured with `images.remote_timeout` in `ImageResolver`.As per path instructions, user-facing documentation in English under docs/ must not invent features, versions, or commands.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **Mitigation**: Keep remote resolution **disabled** (recipe default and `when@prod: resolve_remote: false`). `RemoteImageHostPolicy` **denies** remote hosts when `remote_host_allowlist` is empty — configure an explicit allowlist before enabling remote. Terminate outbound traffic at the network layer; prefer base64 or controlled CDN URLs at the application layer. HTTP timeouts are limited (10s) in `ImageResolver`. | |
| - **Mitigation**: Keep remote resolution **disabled** (recipe default and `when@prod: resolve_remote: false`). `RemoteImageHostPolicy` **denies** remote hosts when `remote_host_allowlist` is empty — configure an explicit allowlist before enabling remote. Terminate outbound traffic at the network layer; prefer base64 or controlled CDN URLs at the application layer. HTTP timeouts default to 10s and can be configured with `images.remote_timeout` in `ImageResolver`. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/SECURITY.md` at line 52, Update the ImageResolver timeout statement in
the security documentation to describe 10 seconds as the default used when no
images.remote_timeout setting is provided, not as an enforced limit. Preserve
the surrounding mitigation guidance and avoid implying a maximum timeout.
Source: Path instructions
|
@coderabbitai review |
|
Summary
resolve_remote: false+when@prodoverrideFixes #31
Test plan
Made with Cursor
Summary by CodeRabbit