Safeguard
Application Security•

CWE-1057 Data Access Outside the Data Manager Component

Your design says all data access goes through one component, but some code goes around it. CWE-1057 explains the performance and review cost.

Safeguard Security Team
2 min read

CWE-1057 applies when a product has a dedicated, central data manager by design, yet some code performs data access without using it. It affects teams that centralize persistence, caching or query logic in one module and then let exceptions creep in.

How it happens

The data manager is the agreed route. It may batch queries, cache results, or apply common handling. A developer in a hurry opens a connection directly and runs a query inline. The feature ships, and now there are two ways to read the same data.

// Pattern to avoid: a direct query beside a central DataManager
Connection c = DriverManager.getConnection(url);
ResultSet rs = c.createStatement().executeQuery("SELECT name FROM users");
// Better: use the component the design requires
List<String> names = dataManager.userNames();

What an attacker gains

MITRE lists an availability consequence: reduced performance. The central manager "may have been explicitly optimized," so bypassing it can make the product slower. If an attacker can reach that code, the slowdown "might introduce a vulnerability," for example by making resource exhaustion easier.

How to find it

The record lists no detection methods. Search the codebase for direct database client calls outside the data manager package. A simple rule in code review or a dependency check between packages works well.

How to fix it

  1. Move the direct access into the data manager, or add the method it lacks.
  2. Make the database client library visible only to the data manager package, so bypassing it fails at build time.
  3. Document the rule so reviewers know what to reject.

Quick check

Is this mainly a performance weakness?

According to the record, yes. The listed consequence is reduced performance, which can become a security issue if attackers can trigger it.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.