CWE-777 详情

CWE-777

Regular Expression without Anchors
2009-07-27
00h00 +00:00
中危
Incomplete
2026-10-28
00h00 +00:00
指定 CWE 通知
随时了解指定 CWE 的变更。
管理通知

名称: Regular Expression without Anchors

The product uses a regular expression to perform neutralization, but the regular expression omits one or more anchors that may allow malicious or malformed data to slip through.

基本信息

背景详情

引入方式

Implementation

适用平台

编程语言

类: Not Language-Specific (Undetermined)
名称: Python (Undetermined)

技术

类: Not Technology-Specific (Undetermined)

常见后果

影响范围 影响 可能性
Availability
Confidentiality
Access Control
Bypass Protection Mechanism, Varies by Context

注意: An unanchored regular expression in the context of an allowlist will possibly result in a protection mechanism failure. Malicious or malformed data may be included before or after any string matching the regular expression, allowing the data to enter trusted regions of the program. The type of malicious data that is allowed will depend on the context of the application and which anchors are omitted from the regular expression. The specific consequences will depend on what functionality the allowlist was protecting.

观察示例

参考资料 描述

CVE-2022-30034

Chain: Web UI for a Python RPC framework does not use regex anchors to validate user login emails (CWE-777), potentially allowing bypass of OAuth (CWE-1390).

潜在缓解措施

Phases : Implementation
Be sure to understand both what will be matched and what will not be matched by a regular expression. Anchoring the ends of the expression will allow the programmer to define an allowlist strictly limited to what is matched by the text in the regular expression. If you are using a package that only matches one line by default, ensure that you can match multi-line inputs if necessary.

漏洞映射说明

依据 : This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
备注 : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

提交记录

名称 组织 日期 发布日期 Version
CWE Content Team MITRE 2009-06-30 +00:00 2009-07-27 +00:00 1.5

修改记录

名称 组织 日期 备注
CWE Content Team MITRE 2010-06-21 +00:00 updated Description
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2017-11-08 +00:00 updated Likelihood_of_Exploit
CWE Content Team MITRE 2020-02-24 +00:00 updated Relationships
CWE Content Team MITRE 2020-06-25 +00:00 updated Common_Consequences, Description, Potential_Mitigations
CWE Content Team MITRE 2022-10-13 +00:00 updated Demonstrative_Examples, Observed_Examples
CWE Content Team MITRE 2023-01-31 +00:00 updated Description
CWE Content Team MITRE 2023-04-27 +00:00 updated Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2025-12-11 +00:00 updated Applicable_Platforms, Weakness_Ordinalities
CWE Content Team MITRE 2026-10-28 +00:00 updated Applicable_Platforms, Background_Details, Common_Consequences, Description