Unrestricted deserializing from a privileged context allows an attacker to supply crafted input which, upon deserialization, can yield objects that the attacker lacks permissions to construct. One example of this is the construction of a sensitive object, such as a custom class loader. Consequently, avoid deserializing from a privileged context. When deserializing requires privileges, programs must strip all permissions other than the minimum set required for the intended usage. See rules void SEC12the rule SEC02-J. Do not grant untrusted code access to classes in inaccessible packages and void SEC13-J. Do not allow unauthorized construction of classes in inaccessible packages Remove superfluous code from privileged blocks for additional information.
...
This vulnerability was fixed in JDK v1.6 u11 by defining a new AccessControlContext
INSTANCE
, with a new ProtectionDomain
. The ProtectionDomain
encapsulated a RuntimePermission
called accessClassInPackage.sun.util.calendar
. Consequently, the code was granted the minimal set of permissions required to access the sun.util.calendar
class. This whitelisting approach guaranteed that a security exception would be thrown in all other cases of invalid access. Refer to rule void SEC12-J. Do not grant untrusted code access to classes in inaccessible packages for more details on allowing or disallowing access to packages. Finally, the two-argument form of doPrivileged()
allows stripping all permissions other than the ones specified in the ProtectionDomain
.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e5ca9fc720c50e6f-c2c7f2a0-4c704621-a4cd8064-6dae3097d5d95d6b9bc22906"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] |
| ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ae8e38938f5cfed1-4119a917-4f4d4f86-b2b69200-c5212688a896316804b875ed"><ac:plain-text-body><![CDATA[ | [[CVE | AA. Bibliography#CVE]] | [CVE-2008-5353 | http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5353] | ]]></ac:plain-text-body></ac:structured-macro> |
...