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

目标: 1000 元 · 已筹: 1359 元

100%

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

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

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

MITRE CWE 官方描述
CWE:CWE-185 Incorrect Regular Expression 英文:产品以导致数据被错误匹配或比较的方式指定了正则表达式(Regular Expression)。 当正则表达式(Regular Expression)被用于过滤或验证等保护机制时,这可能允许攻击者绕过对输入数据的预期限制。
常见影响 (2)
Other Unexpected 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 Control Bypass Protection Mechanism
In PHP, regular expression checks can sometimes be bypassed with a null byte, leading to any number of weaknesses.
缓解措施 (1)
Implementation Regular 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-88021 HashiCorp Consul 输入验证错误漏洞 — Consul 7.5 High 2026-09-10
CVE-2026-73425 withastro astro 输入验证错误漏洞 — astro 3.7 Low 2026-08-12
CVE-2026-64655 GitHub CLI 输入验证错误漏洞 — cli 2.1 Low 2026-08-06
CVE-2026-45065 Symfony 输入验证错误漏洞 — symfony - - 2026-07-14
CVE-2026-56021 Webmin 输入验证错误漏洞 — Webmin 5.3 Medium 2026-06-18
CVE-2026-47674 Hono 安全漏洞 — hono 5.3 Medium 2026-05-28
CVE-2026-48147 Budibase 安全漏洞 — budibase 6.5 Medium 2026-05-27
CVE-2026-4296 GitHub Enterprise Server 安全漏洞 — Enterprise Server 8.2AI High AI 2026-04-21
CVE-2026-25542 Tekton Pipelines 安全漏洞 — pipeline 6.5 Medium 2026-04-21
CVE-2026-39350 Istio 安全漏洞 — istio 5.4 Medium 2026-04-15
CVE-2026-33418 DiceBear 安全漏洞 — dicebear 7.5 High 2026-03-24
CVE-2026-27895 LDAP Account Manager 安全漏洞 — lam 4.3 Medium 2026-03-17
CVE-2026-3419 Fastify 安全漏洞 — fastify 5.3 Medium 2026-03-06
CVE-2026-25896 fast-xml-parser 安全漏洞 — fast-xml-parser 9.3 Critical 2026-02-20
CVE-2026-25479 Litestar 安全漏洞 — litestar 6.5 Medium 2026-02-09
CVE-2026-24398 Hono 安全漏洞 — hono 4.8 Medium 2026-01-27
CVE-2025-20139 Cisco Enterprise Chat and Email 安全漏洞 — Cisco Enterprise Chat and Email 7.5 High 2025-04-02
CVE-2024-52289 authentik 安全漏洞 — authentik 6.1AI Medium AI 2024-11-21
CVE-2024-6641 WordPress plugin WP Hardening 安全漏洞 — WP Hardening (discontinued) 5.3 Medium 2024-09-18
CVE-2024-2223 Bitdefender GravityZone Update Server 安全漏洞 — GravityZone Control Center (On Premises) 8.1 High 2024-04-09
CVE-2021-36093 OTRS 安全漏洞 — ((OTRS)) Community Edition 5.3 Medium 2021-09-06
CVE-2018-1109 Npm Braces 资源管理错误漏洞 — nodejs-braces 5.3 - 2021-03-30
CVE-2020-7929 Mongodb Server 安全漏洞 — MongoDB Server 6.5 Medium 2021-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 Medium 2020-04-24
CVE-2018-7158 Joyent Node.js path模块输入验证错误漏洞 — Node.js 7.5 - 2018-05-17

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