CWE-1078: Inappropriate Source Code Style or Formatting
The source code does not follow desired style or formatting for indentation, white space, comments, etc.
Last updated
Overview
CWE-1078 (Inappropriate Source Code Style or Formatting) is a class-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
1 recorded CVEs are caused by CWE-1078 (Inappropriate Source Code Style or Formatting). The highest-severity and most recent are shown first.
Common consequences
What can happen when CWE-1078 is exploited.
Increase Analytical Complexity
Affects: Other
Variations in indentation and other white space, comments, etc. can make it more difficult for human analysts to understand the actual behavior that is being implemented.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to detect it
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.)
Effectiveness: High
Automated Static Analysis - Source Code
An Integrated Development Environment (IDE) or linter can report or highlight this weaknesses.
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
The usage of symbolic names instead of hard-coded constants is preferred.
Vulnerable example
char buffer[1024];Safe example
enum { MAX_BUFFER_SIZE = 1024 };Frequently asked questions
Common questions about CWE-1078.
- What is CWE-1078?
- The source code does not follow desired style or formatting for indentation, white space, comments, etc.
- What CVEs are caused by CWE-1078?
- 1 recorded CVEs are attributed to CWE-1078, including CVE-2024-0667.
- How is CWE-1078 detected?
- 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.)
- What are the consequences of CWE-1078?
- Exploiting CWE-1078 can lead to: Increase Analytical Complexity.
- Is CWE-1078 actively exploited?
- 1 recorded CVEs are caused by CWE-1078; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-1078) (opens in a new tab)
- CWE-1078 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-1078
Get alerted the moment a new CWE-1078 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.