# OAuth2-Proxy 头部伪装漏洞
N/A
是否为 Web 类漏洞: 未知
判断理由:
标题: RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES -- 🔗来源链接
标签:x_refsource_MISC
神龙速读:
该链接的内容为空,无法处理。
标题: Header smuggling via underscore leading to potential privilege escalation · Advisory · oauth2-proxy/oauth2-proxy · GitHub -- 🔗来源链接
标签:x_refsource_CONFIRM
神龙速读:
### 关键信息摘要
- **漏洞标题**: Header smuggling via underscore leading to potential privilege escalation
- **严重性**: High
- **CVE ID**: CVE-2025-64484
- **受影响版本**: <=7.12.0
- **修复版本**: 7.13.0
- **漏洞描述**:
- **影响**:
- OAuth2 Proxy部署在将下划线规范化为破折号的HTTP标题中的应用之前(例如,基于WSGI的框架,如Django、Flask、FastAPI和PHP应用)。
- 认证用户可以通过注入下划线变体的X-Forwarded-*头部旁路代理的过滤逻辑,导致上游应用中的特权升级。OAuth2 Proxy自身的验证/授权并未被攻破。
- **补丁**:
- 此更改缓解了一个Header Smuggling漏洞,攻击者可以通过使用不同的大写或替换下划线旁路标题剥离请求头。
- 默认所有指定的头部将被规范化,这意味着大写和下划线和破折号在匹配要移除的头时将被忽略。例如,X-Forwarded-For和X_Forwarded-for将被视为等效并被移除。
- 但是,如果你有合理的理由需要保留类似的标题并且不想移除它,我们引入了一个新的配置字段,用于通过AlphaConfig管理的头部,称为InsecureSkipHeaderNormalization。
- **绕过**:
- 确保上游服务中的过滤和处理逻辑不以相同方式对待下划线和连字符。
- **参考资料**:
- https://github.security.telekom.com/2020/05/smuggling-http-headers-through-reverse-proxies.html
- https://www.uptimia.com/questions/why-are-http-headers-with-underscores-dropped-by-nginx
- https://datatracker.ietf.org/doc/html/rfc2616#section-4.2
- https://datatracker.ietf.org/doc/html/rfc822#section-3.2
标题: Why Are HTTP Headers With Underscores Dropped By Nginx? -- 🔗来源链接
标签:x_refsource_MISC
神龙速读:
From the screenshot, the following key information about the vulnerability can be extracted:
- **Problem**: Nginx, by default, drops HTTP headers with underscores.
- **Reason**: This behavior is related to the CGI legacy and header mapping.
- **Impact**: It can cause issues in web applications using custom headers with underscores or third-party services.
- **Solution**: To handle underscore headers in Nginx, add the "underscores_in_headers on;" directive to the server, http, or location block in the Nginx configuration.
标题: Smuggling HTTP headers through reverse proxies -- 🔗来源链接
标签:x_refsource_MISC
神龙速读:
### 关键信息总结
- **漏洞类型**: Smuggling HTTP Headers Through Reverse Proxies
- **影响范围**: 由于HTTP头部规范化和解析器差异导致的漏洞,尤其是在使用mTLS验证中用于传递认证数据的场景。
- **漏洞原理**:
- **Apache与认证绕过**: 当Apache作为反向代理服务器时,其默认的规范化和转发机制可能导致认证头部被转发并被应用层识别,即使这些头部在Apache层面被unset。
- **-headers撞库**: 在某些框架(如Flask、Django)中,由于反向代理传递的headers未被删除干净,可能导致认证信息混迭。
- **影响组件**:
- **Web应用语言**: PHP、Python (如Django、Flask)、其他WSGI应用等。
- **应用服务器与服务端**: Apache、Nginx、Gunicorn等。
- **缓解措施**:
- 始终在Apache配置的根Level unset认证相关的头部。
- 不使用Adrain、Hyphen字符去构建敏感头字段,避免规范化导致的风险。
- 考虑关注头字段的转发路径及可能的转化规则,在搭建中间件时要特别关注并剔除可能产生混淆的头字段。
### 说明
该漏洞涉及到多种web前端与后端的技术点,在实际业务的搭建中,防护的措施与技术实现需要前后端有良好的配合及规范,防止发现不一致的解析行为。
暂无评论