Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tool
Version
Checker
Description
CodeSonar4.2

FB.MALICIOUS_CODE.EI_EXPOSE_REP

FB.MALICIOUS_CODE.EI_EXPOSE_REP2

May expose internal representation by returning reference to mutable object

May expose internal representation by incorporating reference to mutable object

Coverity7.5

FB.EI_EXPOSE_REP2
FB.EI_EXPOSE_REP

Implemented
Klocwork

Include Page
Klocwork_V
Klocwork_V

SV.EXPOSE.RET
SV.EXPOSE.STORE

Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.OBJ04.CLONE
CERT.OBJ04.CPCL
CERT.OBJ04.MPT
CERT.OBJ04.SMO
CERT.OBJ04.MUCOP
Make your 'clone()' method "final" for security
Enforce returning a defensive copy in 'clone()' methods
Do not pass user-given mutable objects directly to certain types
Do not store user-given mutable objects directly into variables
Provide mutable classes with copy functionality

Related Guidelines

MITRE CWE

CWE-374, Passing Mutable Objects to an Untrusted Method
CWE-375, Returning a Mutable Object to an Untrusted Caller

Secure Coding Guidelines for Java SE, Version 5.0

Guideline 6-4 / MUTABLE-4: Support copy functionality for a mutable class

...