CWE-572: Call to Thread run() instead of start()
The product calls a thread's run() method instead of calling start().
Last updated
Overview
CWE-572 (Call to Thread run() instead of start()) is a variant-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.
Common consequences
What can happen when CWE-572 is exploited.
Quality Degradation, Varies by Context
Affects: Other
The run() method will execute in the caller's thread of control, when the intention was likely to run in the thread of the callee.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
How to prevent it
Practical mitigations for CWE-572, grouped by where in the lifecycle they apply.
Use the start() method instead of the run() method.
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
Code examples
MITRE examples of the weakness in code.
The following excerpt from a Java program mistakenly calls run() instead of start().
Vulnerable example
Thread thr = new Thread() {
public void run() {
...
}
};
thr.run();Terminology & mappings
Mapped taxonomies
- The CERT Oracle Secure Coding Standard for Java (2011): Do not invoke Thread.run() (THI00-J)
- Software Fault Patterns: Use of an improper API (SFP3)
Frequently asked questions
Common questions about CWE-572.
- What is CWE-572?
- The product calls a thread's run() method instead of calling start().
- How do you prevent CWE-572?
- Use the start() method instead of the run() method.
- How is CWE-572 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-572?
- Exploiting CWE-572 can lead to: Quality Degradation, Varies by Context.
References
- MITRE CWE definition (CWE-572) (opens in a new tab)
- CWE-572 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-572 CVEs
Get an alert when a new CWE-572 CVE affects your products, with AI-written analysis and remediation steps.