Description
The source code does not follow desired style or formatting for indentation, white space, comments, etc.
Potential Impact
Other
Increase Analytical Complexity
Demonstrative Examples
char buffer[1024];...fgets(buffer, 1024, stdin);enum { MAX_BUFFER_SIZE = 1024 };...char buffer[MAX_BUFFER_SIZE];...fgets(buffer, MAX_BUFFER_SIZE, stdin);Detection Methods
- Automated Static Analysis High — 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 sea
- Automated Static Analysis - Source Code — An Integrated Development Environment (IDE) or linter can report or highlight this weaknesses.
Related Weaknesses
Frequently Asked Questions
What is CWE-1078?
CWE-1078 (Inappropriate Source Code Style or Formatting) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Class-level weakness. The source code does not follow desired style or formatting for indentation, white space, comments, etc.
How can CWE-1078 be exploited?
Attackers can exploit CWE-1078 (Inappropriate Source Code Style or Formatting) to increase analytical complexity. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-1078?
Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.
What is the severity of CWE-1078?
CWE-1078 is classified as a Class-level weakness (High abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.