Konloch/bytecode-viewer · error · SecurityException
BCV is awesome, blocking port
Error message
BCV is awesome, blocking port
What it means
SecurityMan.checkListen unconditionally throws SecurityException for any port binding attempt while BCV's SecurityManager is installed. BCV intentionally forbids analyzed or plugin code from opening listening sockets on the host. Any ServerSocket/socket listen call under the sandbox therefore fails immediately.
Source
Thrown at src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java:198
return fullyQualifiedClassName.equals(KrakatauDecompiler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(KrakatauDisassembler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(CFRDecompiler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(ProcyonDecompiler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(FernFlowerDecompiler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(JDGUIDecompiler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(KrakatauAssembler.class.getCanonicalName())
|| fullyQualifiedClassName.equals(ExternalResources.class.getCanonicalName())
|| fullyQualifiedClassName.equals(Enjarify.class.getCanonicalName())
|| fullyQualifiedClassName.equals(APKTool.class.getCanonicalName())
|| fullyQualifiedClassName.equals(BytecodeViewer.class.getCanonicalName())
|| fullyQualifiedClassName.equals(Constants.class.getCanonicalName())
|| fullyQualifiedClassName.equals(JavaCompiler.class.getCanonicalName());
}
@Override
public void checkListen(int port)
{
throw new SecurityException("BCV is awesome, blocking port " + port + " from listening");
}
@Override
public void checkPermission(Permission perm)
{ //expand eventually
}
@Override
public void checkPermission(Permission perm, Object context)
{//expand eventually
}
@Override
public void checkAccess(Thread t)
{
}
@OverrideView on GitHub (pinned to 31430e0033)
Solutions
- Refactor the plugin/library so it does not open listening sockets during analysis
- Run the server outside BCV's sandboxed execution path
- If legitimately needed, modify BCV's SecurityMan (canClassExecute-style whitelist) in a local build — stock BCV blocks all listens
- Use client-side (connect) communication where policy allows instead of listening sockets
Defensive patterns
Strategy: try-catch
Validate before calling
// no portable pre-check exists; assume all listens are blocked under BCV boolean listenBlockedUnderBCV = true;
Try / catch
try (ServerSocket ss = new ServerSocket(port)) {
// serve
} catch (SecurityException e) {
if (e.getMessage().startsWith("BCV is awesome, blocking port")) {
// run server outside BCV or disable network feature
} else throw e;
} Prevention
- Avoid server sockets in plugins/analyzed code entirely
- Use BCV-approved IPC instead of listening ports
- Defer network servers to standalone execution outside the sandbox
- Expect unconditional blocking: stock SecurityMan allows no listens
When it happens
Trigger: Plugin or analyzed/decompiled code constructs a ServerSocket or otherwise calls listen on a port while BCV's SecurityManager is active.
Common situations: Plugins starting embedded servers (HTTP, debug agents); analyzed libraries that open server sockets during static analysis execution; test harnesses attempting local port binds inside the sandbox.
Related errors
- BCV is awesome! Blocking exec:
- BCV is awesome, blocking System.exit(
- BCV is awesome, blocking write(
- Unknown constant pool tag ${tag}
- null key or factory
AI-assisted analysis of Konloch/bytecode-viewer@31430e0033 (2026-09-05).
Data as JSON: /api/errors/98b55a4837f5ea41.
Report an issue: GitHub.