fix: port upstream gateway.real_ip_fallback_enabled conditional severity (upstream #23428)#353
Merged
jiulingyun merged 2 commits intomainfrom Mar 1, 2026
Merged
Conversation
…penclaw#23428) Co-authored-by: jiulingyun <126459548+jiulingyun@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Resolve conflicts and apply upstream security audit fixes
fix: port upstream gateway.real_ip_fallback_enabled conditional severity (upstream #23428)
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports upstream commit
29e41d4c0ac2to the fork. Thegateway.real_ip_fallback_enabledaudit finding previously had no concept of loopback-only proxy setups, meaning a loopback-bound gateway with all-loopbacktrustedProxieswould still firecriticalinstead ofwarn.Changes
src/config/types.gateway.ts: AddallowRealIpFallback?: booleantoGatewayConfig.src/security/audit.ts:allowRealIpFallbackcheck incollectGatewayConfigFindingswith conditional severity:criticalwhenbind !== "loopback"or whentrusted-proxyauth mode has at least one non-loopback proxy entry;warnotherwise.isLoopbackOnlyTrustedProxyEntry(entry)helper — handles plain IPs, IPv4 CIDRs (rejects prefix< 8to prevent ranges extending beyond127.0.0.0/8), and IPv6 (only::1/128qualifies).src/security/audit.test.ts: Add parametrized test covering all four severity branches:Notes
CHANGELOG.md,extensions/feishu/, andREADME.mdintentionally not modified (protected fork files).src/commands/sessions.test-helpers.tstemp-path refactor skipped — file does not exist in this fork.auth.mode === "trusted-proxy"cast viaas stringsince the fork'sResolvedGatewayAuthModepredates trusted-proxy support; the guard is forward-compatible once that mode lands.Original prompt
This section details on the original issue you should resolve
<issue_title>upstream(feishu): 移植 1 个冲突 commit (P0) — v2026.2.21→v2026.2.23</issue_title>
<issue_description>## 任务
将以下 1 个上游 commit 的修改语义化应用到本 fork。这些 commit 无法直接 cherry-pick(存在冲突),需要理解修改意图后手动应用等效变更。
上游版本范围
feishu需要移植的 commit
Commit 1:
29e41d4c0ac2(P0)描述: fix: land security audit severity + temp-path guard fixes (openclaw#23428) (thanks @bmendonca3)
涉及文件:
CHANGELOG.md,extensions/feishu/src/dedup.ts,src/commands/sessions.test-helpers.ts,src/security/audit.test.ts,src/security/audit.ts查看上游 diff