CWE-1062 Base Incomplete

Parent Class with References to Child Class

This weakness occurs when a parent class directly references its child classes, their methods, or their member variables, creating a problematic and tightly coupled dependency.

Definition

What is CWE-1062?

This weakness occurs when a parent class directly references its child classes, their methods, or their member variables, creating a problematic and tightly coupled dependency.
This design flaw creates a fragile inheritance structure where the parent class is no longer a stable, independent blueprint. It becomes dependent on the specific implementation details of its children, violating core object-oriented principles. This coupling makes the code difficult to maintain, as changes in a child class can unexpectedly break the parent class, leading to runtime errors and unreliable behavior. From a security perspective, while not a direct vulnerability, this unreliability can be exploited. If an attacker can reach or influence this unstable code path, they might trigger crashes, bypass logic, or cause unexpected state changes. The resulting instability transforms a code quality issue into a potential entry point for denial-of-service or other attacks that exploit the program's unpredictable behavior.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-1062

Bisher sind in MITREs Katalog keine öffentlichen CVE-Referenzen mit dieser CWE verknüpft.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    Identifiziere einen Codepfad, der nicht vertrauenswürdige Eingaben ohne Validierung verarbeitet.

  2. 2

    Erzeuge eine Payload, die das unsichere Verhalten auslöst — Injection, Traversal, Overflow oder Logik-Missbrauch.

  3. 3

    Liefere die Payload über einen normalen Request aus und beobachte die Reaktion der Anwendung.

  4. 4

    Iteriere, bis die Antwort Daten preisgibt, Angreifer-Code ausführt oder Berechtigungen eskaliert.

Verwundbares Codebeispiel

Vulnerable pseudo

MITRE hat kein Codebeispiel für diese CWE veröffentlicht. Das untenstehende Muster ist illustrativ — kanonische Referenzen findest du unter Ressourcen.

Verwundbar pseudo
// Example pattern — see MITRE for the canonical references.
function handleRequest(input) {
  // Untrusted input flows directly into the sensitive sink.
  return executeUnsafe(input);
}
Sicheres Codebeispiel

Secure pseudo

Sicher pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-1062

  • Architecture Use safe-by-default frameworks and APIs that prevent the unsafe pattern from being expressible.
  • Implementation Validate input at trust boundaries; use allowlists, not denylists.
  • Implementation Apply the principle of least privilege to credentials, file paths, and runtime permissions.
  • Testing Cover this weakness in CI: SAST rules + targeted unit tests for the data flow.
  • Operation Monitor logs for the runtime signals listed in the next section.
Erkennungssignale

How to detect CWE-1062

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-1062 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-1062?

This weakness occurs when a parent class directly references its child classes, their methods, or their member variables, creating a problematic and tightly coupled dependency.

Wie gravierend ist CWE-1062?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-1062 betroffen?

MITRE hat für diese CWE keine betroffenen Plattformen spezifiziert — sie kann in den meisten Anwendungs-Stacks auftreten.

Wie kann ich CWE-1062 verhindern?

Use safe-by-default frameworks, validate untrusted input at trust boundaries, and apply the principle of least privilege. Cover the data-flow signature in CI with SAST.

Wie erkennt und behebt Plexicus CWE-1062?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-1062 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-1062?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/1062.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Verwandte Schwachstellen

Weaknesses related to CWE-1062

CWE-1061 Parent

Insufficient Encapsulation

This weakness occurs when a software component exposes too much of its internal workings, such as data structures or implementation logic.…

CWE-1054 Sibling

Invocation of a Control Element at an Unnecessarily Deep Horizontal Layer

This weakness occurs when code in one architectural layer directly calls functions or methods in a much deeper layer, skipping over the…

CWE-1057 Sibling

Data Access Operations Outside of Expected Data Manager Component

This weakness occurs when an application bypasses its dedicated, central data manager component and performs data access operations…

CWE-1083 Sibling

Data Access from Outside Expected Data Manager Component

This weakness occurs when an application is designed to handle all data operations through a dedicated manager component (like a database…

CWE-1090 Sibling

Method Containing Access of a Member Element from Another Class

This weakness occurs when a method in one class directly accesses a private or internal member (like a field or property) of a different…

CWE-1100 Sibling

Insufficient Isolation of System-Dependent Functions

This weakness occurs when an application fails to separate its core logic from functions that depend on a specific operating system,…

CWE-1105 Sibling

Insufficient Encapsulation of Machine-Dependent Functionality

This weakness occurs when an application relies on hardware-specific or platform-dependent features but fails to isolate that code from…

CWE-766 Sibling

Critical Data Element Declared Public

This vulnerability occurs when a critical piece of data—like a variable, field, or class member—is mistakenly declared as public when it…

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.