fix(security): enforce whitelist with blacklist and harden wildcard rules

This commit is contained in:
kl
2026-03-03 14:35:56 +08:00
parent a20606bf33
commit 2abedc34b4
3 changed files with 51 additions and 4 deletions

View File

@@ -146,11 +146,15 @@ trust.host = *
### Q4: 如何允许子域名
目前不支持通配符域名匹配需要明确列出每个子域名
支持通配符域名匹配可使用 `*.example.com`
```properties
trust.host = cdn.example.com,api.example.com,storage.example.com
trust.host = *.example.com
```
说明
- `*.example.com` 会匹配 `cdn.example.com``api.internal.example.com`但不匹配根域 `example.com`
- 对于 IP 风格通配 `192.168.*``10.*`仅匹配字面量 IPv4 地址不匹配域名
## 🚨 安全事件响应
如果发现可疑的预览请求