Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: "the reference elements" --> "the referenced elements"

...

This compliant solution avoids the TOCTOU vulnerability by copying the mutable input and performing all operations on the copy. Consequently, an attacker's changes to the mutable input cannot affect the copy. Acceptable techniques include using a copy constructor or implementing the java.lang.Cloneable interface and declaring a public clone method (for classes not declared final). In cases like HttpCookie where the mutable class is declared final — that is, it cannot provide an accessible copy method — perform a manual copy of the object state within the caller. See rule OBJ04-J. Provide mutable classes with copy functionality to safely allow passing instances to untrusted code safely for more information. Note that any input validation must be performed on the copy and not on the original object.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="36d390ea483952cd-b2786215-49394a85-bfe1bb40-97a2682b558a2cb6795b4b82"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 08]]

Item 39: Make defensive copies when needed

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="602f88326c25bf4e-8dcbc4aa-420d4f00-b3ec94f0-77e8dcf39a9fd4412f2cd20a"><ac:plain-text-body><![CDATA[

[[Pugh 2009

AA. Bibliography#Pugh 09]]

Returning references to internal mutable state

]]></ac:plain-text-body></ac:structured-macro>

...