Serial Killer Silently Pwning Your Java Endpoints

asd-f03-serial-killer-silently-pwning-your-java-endpoints asd-f03-serial-killer-silently-pwning-your-java-endpoints

04.03.2016 Views

Exploi;ng "Magic Methods" Abusing "magic methods" of gadgets which have dangerous code: AEacker controls member fields’ values of serialized object Upon deserializa@on .readObject() / .readResolve() is invoked Implementa@on of this method in gadget class uses aMacker-controlled fields Aside from the classic ones also lesser-known "magic methods" help: .validateObject() as part of valida@on (which does not prevent aEacks) .readObjectNoData() upon deserializa@on conflicts .finalize() as part of GC (even ajer errors) with deferred execu@on bypassing ad-hoc SecurityManagers at deserializa@on Works also for Externalizable’s .readExternal() 8

Exploi;ng "Magic Methods" But what if there are no "Magic Methods" on the target’s ClassPath that have "dangerous code" for the aEacker to influence? 9

Exploi;ng "Magic Methods"<br />

Abusing "magic methods" of gadgets which have dangerous code:<br />

AEacker controls member fields’ values of serialized object<br />

Upon deserializa@on .readObject() / .readResolve() is invoked<br />

Implementa@on of this method in gadget class uses aMacker-controlled fields<br />

Aside from the classic ones also lesser-known "magic methods" help:<br />

.validateObject() as part of valida@on (which does not prevent aEacks)<br />

.readObjectNoData() upon deserializa@on conflicts<br />

.finalize() as part of GC (even ajer errors)<br />

with deferred execu@on bypassing ad-hoc SecurityManagers at deserializa@on<br />

Works also for Externalizable’s .readExternal()<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!