CWE-915: Improperly Controlled Modification of… | Glexia
CWE-915 (Improperly Controlled Modification of Dynamically-Determined Object Attributes) weakness overview with consequences, detection methods, mitigations,…
Glexia's Take · Automated analysis
CWE-915: Mass Assignment
Improperly Controlled Modification of Dynamically-Determined Object Attributes represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Integrity: Modify Application Data: An attacker could modify sensitive data or program variables.
- Integrity: Execute Unauthorized Code or Commands
- Other,Integrity: Varies by Context,Alter Execution Logic
Developer Pattern
CWE-915 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Automation confidence
high confidence from CWE-915, 4.20.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Official CWE Definition
CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
The product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- This function sets object attributes based on a dot-separated path. This function does not check if the attribute resolves to the object prototype. These codes can be used to add "isAdmin: true" to the object prototype.,By using a denylist of dangerous attributes, this weakness can be eliminated.
Remediation
- Implementation:
- Architecture and Design,Implementation: If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- Implementation: For any externally-influenced input, check the input against an allowlist of internal object attributes or fields that are allowed to be modified.
- Implementation,Architecture and Design: Refactor the code so that object attributes or fields do not need to be dynamically identified, and only expose getter/setter functionality for the intended attributes.
Detection
- 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.)
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.
