The container is responsible for creating and managing the connection pool,
as well as monitoring the usage of connections and releasing them when they are no longer needed.
By delegating connection management to the container, JEE applications can avoid connection leaks and resource exhaustion and ensure that database connections are used efficiently and securely.
When an application manages connections directly, connection leaks may arise.
These leaks occur when an application fails to release a database connection after it has finished using it.
Another risk is vulnerability to SQL injection attacks, which occur when an attacker is able to inject malicious SQL code
into an application's database queries, allowing them to access or modify sensitive data.
Finally, these applications have difficulty managing and monitoring database connections.
Without a centralized connection pool, tracking the usage of database connections and ensuring they are used efficiently and securely can be challenging.
\[~nicolas.peru] I've written this rule more narrowly than the CWE example shows: i.e. I've written that we'll raise an issue when a servlet class uses ``++DriverManager++``, but the CWE example shows a delegate class being used to interact with ``++DriverManager++``.
I'm guessing that detecting this case as well will take CFG?
=== on 13 Apr 2015, 14:48:39 Nicolas Peru wrote:
\[~ann.campbell.2]just to be sure of my understanding : you are talking about a servlet using a class of the project using ``++DriverManager++`` ?
This is not related to CFG, but more to an analysis of what is in the project or not. We can find way to do it but it is not easy given the current implementation of things right now to know if a class is defined in the project or not.
I would probably stick to this simpler implementation as a first step.