CWE-245: J2EE Bad Practices: Direct Management of Connections

VariantDraft

The J2EE application directly manages connections, instead of using the container's connection management facilities.

View on MITRE
Back to CWE Lookup

Extended Description

The J2EE standard forbids the direct management of connections. It requires that applications use the container's resource management facilities to obtain connections to resources. Every major web application container provides pooled database connection management as part of its resource management framework. Duplicating this functionality in an application is difficult and error prone, which is part of the reason it is forbidden under the J2EE standard.

Technical Details

Structure
Simple

Applicable To

Languages
Java
Platforms

Frequently Asked Questions

What is CWE-245: J2EE Bad Practices: Direct Management of Connections?+

CWE-245: J2EE Bad Practices: Direct Management of Connections is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The J2EE application directly manages connections, instead of using the container's connection management facilities. The J2EE standard forbids the direct management of connections. It requires that applications use the container's resource management facilities to obtain connections to resources. Every major web application container provides pooled database connection management as part of its resource management framework. Duplicating this functionality in an application is difficult and error prone, which is part of the reason it is forbidden under the J2EE standard.

What are the security consequences of J2EE Bad Practices: Direct Management of Connections?+

If exploited, CWE-245 (J2EE Bad Practices: Direct Management of Connections) it can compromise Other, leading to outcomes such as Quality Degradation.

Which programming languages are affected by J2EE Bad Practices: Direct Management of Connections?+

CWE-245 commonly affects Java. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-245 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More