目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CWE-185 不正确的正则表达式 类漏洞列表 20

CWE-185 不正确的正则表达式 类弱点 20 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-185 属于正则表达式错误类型漏洞,源于产品以不当方式指定正则表达式,导致数据匹配或比较异常。攻击者常利用此缺陷构造特殊输入,绕过基于正则的过滤或验证机制,从而执行未授权操作。开发者应避免使用复杂或模糊的正则模式,优先采用白名单验证策略,并充分测试边界情况,确保正则表达式能准确且安全地处理所有输入数据。

MITRE CWE 官方描述
CWE:CWE-185 Incorrect Regular Expression 英文:产品以导致数据被错误匹配或比较的方式指定了正则表达式(Regular Expression)。 当正则表达式(Regular Expression)被用于过滤或验证等保护机制时,这可能允许攻击者绕过对输入数据的预期限制。
常见影响 (2)
OtherUnexpected State, Varies by Context
When the regular expression is not correctly specified, data might have a different format or type than the rest of the program expects, producing resultant weaknesses or errors.
Access ControlBypass Protection Mechanism
In PHP, regular expression checks can sometimes be bypassed with a null byte, leading to any number of weaknesses.
缓解措施 (1)
ImplementationRegular expressions can become error prone when defining a complex language even for those experienced in writing grammars. Determine if several smaller regular expressions simplify one large regular expression. Also, subject the regular expression to thorough testing techniques such as equivalence partitioning, boundary value analysis, and robustness. After testing and a reasonable confidence lev…
代码示例 (2)
The following code takes phone numbers as input, and uses a regular expression to reject invalid phone numbers.
$phone = GetPhoneNumber(); if ($phone =~ /\d+-\d+/) { # looks like it only has hyphens and digits system("lookup-phone $phone"); } else { error("malformed number!"); }
Bad · Perl
This code uses a regular expression to validate an IP string prior to using it in a call to the "ping" command.
import subprocess import re def validate_ip_regex(ip: str): ip_validator = re.compile(r"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}") if ip_validator.match(ip): return ip else: raise ValueError("IP address does not match valid pattern.") def run_ping_regex(ip: str): validated = validate_ip_regex(ip) # The ping command treats zero-prepended IP addresses as octal result = subprocess.call(["ping", validated]) print(result)
Bad · Python
CVE ID标题CVSS风险等级Published
CVE-2026-4296 GitHub Enterprise Server 安全漏洞 — Enterprise Server 8.2AIHighAI2026-04-21
CVE-2026-25542 Tekton Pipelines 安全漏洞 — pipeline 6.5 Medium2026-04-21
CVE-2026-39350 Istio 安全漏洞 — istio 5.4 Medium2026-04-15
CVE-2026-33418 DiceBear 安全漏洞 — dicebear 7.5 High2026-03-24
CVE-2026-27895 LDAP Account Manager 安全漏洞 — lam 4.3 Medium2026-03-17
CVE-2026-3419 Fastify 安全漏洞 — fastify 5.3 Medium2026-03-06
CVE-2026-25896 fast-xml-parser 安全漏洞 — fast-xml-parser 9.3 Critical2026-02-20
CVE-2026-25479 Litestar 安全漏洞 — litestar 6.5 Medium2026-02-09
CVE-2026-24398 Hono 安全漏洞 — hono 4.8 Medium2026-01-27
CVE-2025-20139 Cisco Enterprise Chat and Email 安全漏洞 — Cisco Enterprise Chat and Email 7.5 High2025-04-02
CVE-2024-52289 authentik 安全漏洞 — authentik 6.1AIMediumAI2024-11-21
CVE-2024-6641 WordPress plugin WP Hardening 安全漏洞 — WP Hardening (discontinued) 5.3 Medium2024-09-18
CVE-2024-2223 Bitdefender GravityZone Update Server 安全漏洞 — GravityZone Control Center (On Premises) 8.1 High2024-04-09
CVE-2021-36093 OTRS 安全漏洞 — ((OTRS)) Community Edition 5.3 Medium2021-09-06
CVE-2018-1109 Npm Braces 资源管理错误漏洞 — nodejs-braces 5.3 -2021-03-30
CVE-2020-7929 Mongodb Server 安全漏洞 — MongoDB Server 6.5 Medium2021-03-01
CVE-2020-3408 Cisco IOS 和 Cisco IOS XE Split DNS 资源管理错误漏洞 — Cisco IOS 8.6 -2020-09-24
CVE-2020-7016 Elasticsearch Kibana 资源管理错误漏洞 — Kibana 4.8 -2020-07-27
CVE-2020-1741 Red Hat OpenShift Container Platform openshift-ansible 安全漏洞 — openshift-ansible 5.9 Medium2020-04-24
CVE-2018-7158 Joyent Node.js path模块输入验证错误漏洞 — Node.js 7.5 -2018-05-17

CWE-185(不正确的正则表达式) 是常见的弱点类别,本平台收录该类弱点关联的 20 条 CVE 漏洞。