CVE-2006-5815 (CNNVD-200611-144)

CRITICAL 有利用代码
中文标题:
ProFTPD SReplace远程单字节溢出漏洞
英文标题:
Stack-based buffer overflow in the sreplace function in ProFTPD 1.3.0 and earlier allows remote atta...
CVSS分数: 10.0
发布时间: 2006-11-08 23:00:00
漏洞类型: 授权问题
状态: PUBLISHED
数据质量分数: 0.40
数据版本: v5
漏洞描述
中文描述:

ProFTPD是一款开放源代码FTP服务程序。 ProFTPD的src/support.c文件中的sreplace()函数在处理特制请求时存在单字节溢出漏洞。漏洞分析代码如下: """ char *sreplace(pool *p, char *s, ...) { va_list args; char *m,*r,*src = s,*cp; char **mptr,**rptr; char *marr[33],*rarr[33]; char buf[PR_TUNABLE_PATH_MAX] = {'\0'}, *pbuf = NULL; size_t mlen = 0, rlen = 0, blen; int dyn = TRUE; cp = buf; *cp = '\0'; memset(marr, '\0', sizeof(marr)); memset(rarr, '\0', sizeof(rarr)); blen = strlen(src) + 1; va_start(args, s); while ((m = va_arg(args, char *)) != NULL & & mlen < sizeof(marr)-1) { char *tmp = NULL; size_t count = 0; if ((r = va_arg(args, char *)) == NULL) break; /* Increase the length of the needed buffer by the difference between * the given match and replacement strings, multiplied by the number * of times the match string occurs in the source string. */ tmp = strstr(s, m); while (tmp) { pr_signals_handle(); count++; /* Be sure to increment the pointer returned by strstr(3), to * advance past the beginning of the substring for which we are * looking. Otherwise, we just loop endlessly, seeing the same * value for tmp over and over. */ tmp += strlen(m); tmp = strstr(tmp, m); } /* We are only concerned about match/replacement strings that actually * occur in the given string. */ if (count) { blen += count * (strlen(r) - strlen(m)); marr[mlen] = m; rarr[mlen++] = r; } } va_end(args); /* Try to handle large buffer situations (i.e. escaping of * PR_TUNABLE_PATH_MAX * (>2048) correctly, but do not allow very big buffer sizes, that may * be dangerous (BUFSIZ may be defined in stdio.h) in some library * functions. */ #ifndef BUFSIZ # define BUFSIZ 8192 #endif if (blen < BUFSIZ) [1] cp = pbuf = (char *) pcalloc(p, ++blen); if (!pbuf) { [2] cp = pbuf = buf; dyn = FALSE; blen = sizeof(buf); } while (*src) { for (mptr = marr, rptr = rarr; *mptr; mptr++, rptr++) { mlen = strlen(*mptr); rlen = strlen(*rptr); if (strncmp(src, *mptr, mlen) == 0) { [3] sstrncpy(cp, *rptr, blen - strlen(pbuf)); if (((cp + rlen) - pbuf + 1) > blen) { pr_log_pri(PR_LOG_ERR, "WARNING: attempt to overflow internal ProFTPD buffers"); cp = pbuf + blen - 1; goto done; } else { cp += rlen; } src += mlen; break; } } if (!*mptr) { [4] if ((cp - pbuf + 1) > blen) { pr_log_pri(PR_LOG_ERR, "WARNING: attempt to overflow internal ProFTPD buffers"); cp = pbuf + blen - 1; } *cp++ = *src++; } } done: *cp = '\0'; if (dyn) return pbuf; return pstrdup(p, buf); } """ blen的值是可控的,如果将其设置为小于BUFSIZ的值的话(见[1])就可以触发堆溢出,否则可以触发栈溢出(见[2])。 由于在[4]行的错误计算,攻击者可以控制pbuf最后的空字节,这样strlen(pbuf)就会大于blen。由于第三个参数为负数时sstrncpy函数仍可运行,因此[3]行的代码会使用攻击者的数据覆盖pbuf缓冲区。 目前已知至少有两种攻击方式: 1. MKD命令 2. pr_display_file

英文描述:

Stack-based buffer overflow in the sreplace function in ProFTPD 1.3.0 and earlier allows remote attackers, probably authenticated, to cause a denial of service and execute arbitrary code, as demonstrated by vd_proftpd.pm, a "ProFTPD remote exploit."

CWE类型:
CWE-119
标签:
remote linux Metasploit OSVDB-68985 Evgeny Legerov
受影响产品
厂商 产品 版本 版本范围 平台 CPE
proftpd_project proftpd * - - cpe:2.3:a:proftpd_project:proftpd:*:*:*:*:*:*:*:*
解决方案
中文解决方案:
(暂无数据)
英文解决方案:
(暂无数据)
临时解决方案:
(暂无数据)
参考链接
ADV-2006-4451 vdb-entry
cve.org
访问
无标题 x_refsource_MISC
cve.org
访问
DSA-1222 vendor-advisory
cve.org
访问
MDKSA-2006:217 vendor-advisory
cve.org
访问
23207 third-party-advisory
cve.org
访问
SSA:2006-335-02 vendor-advisory
cve.org
访问
2006-0066 vendor-advisory
cve.org
访问
20061127 CVE-2006-5815: remote code execution in ProFTPD mailing-list
cve.org
访问
1017167 vdb-entry
cve.org
访问
OpenPKG-SA-2006.035 vendor-advisory
cve.org
访问
23174 third-party-advisory
cve.org
访问
MDKSA-2006:217-1 vendor-advisory
cve.org
访问
proftpd-code-execution(30147) vdb-entry
cve.org
访问
2006-0070 vendor-advisory
cve.org
访问
23069 third-party-advisory
cve.org
访问
23000 third-party-advisory
cve.org
访问
无标题 x_refsource_CONFIRM
cve.org
访问
22821 third-party-advisory
cve.org
访问
23184 third-party-advisory
cve.org
访问
23125 third-party-advisory
cve.org
访问
20992 vdb-entry
cve.org
访问
无标题 x_refsource_CONFIRM
cve.org
访问
23179 third-party-advisory
cve.org
访问
GLSA-200611-26 vendor-advisory
cve.org
访问
22803 third-party-advisory
cve.org
访问
ExploitDB EDB-16852 EXPLOIT
exploitdb
访问
Download Exploit EDB-16852 EXPLOIT
exploitdb
访问
CVE Reference: CVE-2006-5815 ADVISORY
cve.org
访问
ExploitDB EDB-2856 EXPLOIT
exploitdb
访问
Download Exploit EDB-2856 EXPLOIT
exploitdb
访问
CVSS评分详情
10.0
CRITICAL
CVSS向量: AV:N/AC:L/Au:N/C:C/I:C/A:C
CVSS版本: 2.0
机密性
COMPLETE
完整性
COMPLETE
可用性
COMPLETE
时间信息
发布时间:
2006-11-08 23:00:00
修改时间:
2024-08-07 20:04:55
创建时间:
2025-11-11 15:32:38
更新时间:
2026-01-26 02:17:07
利用信息
此漏洞有可利用代码!
利用代码数量: 2
利用来源:
未知 未知
数据源详情
数据源 记录ID 版本 提取时间
CVE cve_CVE-2006-5815 2025-11-11 15:17:46 2025-11-11 07:32:38
NVD nvd_CVE-2006-5815 2025-11-11 14:51:51 2025-11-11 07:41:23
CNNVD cnnvd_CNNVD-200611-144 2025-11-11 15:08:53 2025-11-11 07:49:11
EXPLOITDB exploitdb_EDB-16852 2025-11-11 15:05:26 2025-11-11 08:11:15
EXPLOITDB exploitdb_EDB-2856 2025-11-11 15:05:26 2025-11-11 08:24:16
版本与语言
当前版本: v5
主要语言: EN
支持语言:
EN ZH
其他标识符:
:
:
:
:
安全公告
暂无安全公告信息
变更历史
v5 EXPLOITDB
2025-11-11 16:24:16
references_count: 28 → 30; tags_count: 4 → 5
查看详细变更
  • references_count: 28 -> 30
  • tags_count: 4 -> 5
v4 EXPLOITDB
2025-11-11 16:11:15
references_count: 25 → 28; tags_count: 0 → 4; data_sources: ['cnnvd', 'cve', 'nvd'] → ['cnnvd', 'cve', 'exploitdb', 'nvd']
查看详细变更
  • references_count: 25 -> 28
  • tags_count: 0 -> 4
  • data_sources: ['cnnvd', 'cve', 'nvd'] -> ['cnnvd', 'cve', 'exploitdb', 'nvd']
v3 CNNVD
2025-11-11 15:49:11
vulnerability_type: 未提取 → 授权问题; cnnvd_id: 未提取 → CNNVD-200611-144; data_sources: ['cve', 'nvd'] → ['cnnvd', 'cve', 'nvd']
查看详细变更
  • vulnerability_type: 未提取 -> 授权问题
  • cnnvd_id: 未提取 -> CNNVD-200611-144
  • data_sources: ['cve', 'nvd'] -> ['cnnvd', 'cve', 'nvd']
v2 NVD
2025-11-11 15:41:23
severity: SeverityLevel.MEDIUM → SeverityLevel.CRITICAL; cvss_score: 未提取 → 10.0; cvss_vector: NOT_EXTRACTED → AV:N/AC:L/Au:N/C:C/I:C/A:C; cvss_version: NOT_EXTRACTED → 2.0; affected_products_count: 0 → 1; data_sources: ['cve'] → ['cve', 'nvd']
查看详细变更
  • severity: SeverityLevel.MEDIUM -> SeverityLevel.CRITICAL
  • cvss_score: 未提取 -> 10.0
  • cvss_vector: NOT_EXTRACTED -> AV:N/AC:L/Au:N/C:C/I:C/A:C
  • cvss_version: NOT_EXTRACTED -> 2.0
  • affected_products_count: 0 -> 1
  • data_sources: ['cve'] -> ['cve', 'nvd']