CWEweakness
CWE-1116 Inaccurate Source Code Comments
- Abstraction
- Base
- Structure
- Simple
- Status
- Incomplete
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The source code contains comments that do not accurately
describe or explain aspects of the portion of the code with which the comment is
associated.
Common consequences
• Other: Reduce Maintainability — This issue makes it more difficult to maintain the product, which indirectly affects security by making it more difficult or time-consuming to find and/or fix vulnerabilities. It also might make it easier to introduce vulnerabilities.
• Other: Increase Analytical Complexity — When a comment does not accurately reflect the associated code elements, this can introduce confusion to a reviewer (due to inconsistencies) or make it more difficult and less efficient to validate that the code is implementing the intended behavior correctly.
Potential mitigations
• [Implementation] Verify that each comment accurately reflects what is intended to happen during execution of the code.
Detection methods
• Manual Static Analysis: Compare the comments to the actual code itself to ensure the
comment is consistent with the code. If an inconsistency exists,
consult available documentation for developers of the
product (design, libraries, APIs, etc.) Note that documentation
might be stored in different places than the code repository.
Related
Child of · CWE (1)
- CWE-1078 Inappropriate Source Code Style or Formatting weakness
Referenced by CVE · weakness (4)
- CVE-2025-47271 The OZI action is a GitHub Action that publishes releases to PyPI and mirror releases, signature bundles, and provenance in a tagged… vulnerability
- CVE-2025-1219 In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when requesting a HTTP… vulnerability
- CVE-2022-30351 PDFZorro PDFZorro Online r20220428 using TCPDF 6.2.5, despite having workflows claiming to correctly remove redacted information from a… vulnerability
- CVE-2022-48339 An issue was discovered in GNU Emacs through 28.2. vulnerability