---
title: "CWE-1116: Inaccurate Source Code Comments"
url: https://radicalnotion.ai/cwe/cwe-1116
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1116: Inaccurate Source Code Comments

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 3
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## 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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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.

Effectiveness: Moderate

## Demonstrative examples

### Example 1

In the following Java example the code performs a calculation to determine how much medicine to administer. A comment is provided to give insight into what the calculation should be doing. Unfortunately the comment does not match the actual code and thus leaves the reader to wonder which is correct.

Bad code:

```java
public class Main {
    public static void main(String[] args) {
        int pt_weight = 83;
        int mg_per_kg = 3;
        int daily_dose = 0;

        // Add the patient weight and Mg/Kg to calculate the correct daily dose
        daily_dose = pt_weight * mg_per_kg;
        return dosage;
    }
}
```

Good code:

```java
public class Main {
    public static void main(String[] args) {
        int pt_weight = 83;
        int mg_per_kg = 3;
        int daily_dose = 0;

        // Multiply the patient weight and Mg/Kg to calculate the correct daily dose
        daily_dose = pt_weight * mg_per_kg;
        return dosage;
    }
}
```

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2022-48339 | emacs: command injection vulnerability in htmlfontify.el | high | 7.8 | - | No | 2023-02-20 |
| CVE-2022-30351 | - | high | 7.5 | - | No | 2023-03-30 |
| CVE-2025-1219 | libxml streams use wrong content-type header when requesting a redirected resource | medium | 6.3 | - | No | 2025-03-30 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-1078](https://radicalnotion.ai/cwe/cwe-1078) | Inappropriate Source Code Style or Formatting |

## Frequently asked questions

### What is CWE-1116?

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.

### What CVEs are caused by CWE-1116?

3 recorded CVEs are attributed to CWE-1116, including CVE-2022-48339, CVE-2022-30351 and CVE-2025-1219.

### How do you prevent CWE-1116?

Verify that each comment accurately reflects what is intended to happen during execution of the code.

### How is CWE-1116 detected?

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.

### What are the consequences of CWE-1116?

Exploiting CWE-1116 can lead to: Reduce Maintainability, Increase Analytical Complexity.

### Is CWE-1116 actively exploited?

3 recorded CVEs are caused by CWE-1116; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1116.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1116). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
