CWE-615: Inclusion of Sensitive Information in Source Code Comments

Variant Incomplete Simple

CWE版本: 4.18

更新日期: 2025-09-09

弱点描述

While adding general comments is very useful, some programmers tend to leave important data, such as: filenames related to the web application, old links or links which were not meant to be browsed by users, old code fragments, etc.

扩展描述

An attacker who finds these comments can map the application's structure and files, expose hidden parts of the site, and study the fragments of code to reverse engineer the application, which may help develop further attacks against the site.

常见后果

影响范围: Confidentiality

技术影响: Read Application Data

潜在缓解措施

阶段: Distribution

描述: Remove comments which have sensitive information about the design/implementation of the application. Some of the comments may be exposed to the user and affect the security posture of the application.

检测方法

方法: Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

有效性: High

观察示例

参考: CVE-2007-6197

Version numbers and internal hostnames leaked in HTML comments.

参考: CVE-2007-4072

CMS places full pathname of server in HTML comment.

参考: CVE-2009-2431

blog software leaks real username in HTML comment.

引入模式

阶段 说明
Implementation -
关键信息

CWE ID: CWE-615

抽象级别: Variant

结构: Simple

状态: Incomplete

相关弱点