Difference between revisions of "Passing mutable objects to an untrusted method"

From OWASP
Jump to: navigation, search
Line 1: Line 1:
 +
{{Template:Vulnerability}}
 
{{Template:SecureSoftware}}
 
{{Template:SecureSoftware}}
  
{{Template:Vulnerability}}
+
__TOC__
  
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
+
[[ASDR Table of Contents]]
  
  
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
 
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''
  
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]
+
[[Category:FIXME|This is the text from the old template. This needs to be rewritten using the new template.]]
 
+
[[ASDR Table of Contents]]
+
__TOC__
+
  
  

Revision as of 15:36, 4 November 2008

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.



Contents


ASDR Table of Contents


Last revision (mm/dd/yy): 11/4/2008


Description

Sending non-cloned mutable data as an argument may result in that data being altered or deleted by the called function, thereby putting the calling function into an undefined state.

Consequences

  • Integrity: Potentially data could be tampered with by another function which should not have been tampered with.

Exposure period

  • Implementation: This flaw is a simple logic issue, introduced entirely at implementation time.

Platform

  • Languages: C/C++ or Java
  • Operating platforms: Any

Required resources

Any

Severity

Medium

Likelihood of exploit

Medium

In situations where unknown code is called with references to mutable data, this external code may possibly make changes to the data sent. If this data was not previously cloned, you will be left with modified data which may, or may not, be valid in the context of execution.


Risk Factors

TBD

Examples

In C\C++:

private:
  int foo.
  complexType bar;
  String baz;
  otherClass externalClass; 

public:
  void doStuff() {
    externalClass.doOtherStuff(foo, bar, baz)
  }

In this example, bar and baz will be passed by reference to doOtherStuff() which may change them.


Related Attacks


Related Vulnerabilities

Related Controls

  • Implementation: Pass in data which should not be alerted as constant or immutable.
  • Implementation: Clone all mutable data before returning references to it. This is the preferred mitigation. This way - regardless of what changes are made to the data - a valid copy is retained for use by the class.


Related Technical Impacts


References

Note: A reference to related CWE or CAPEC article should be added when exists. Eg: