Skip to content

Instantly share code, notes, and snippets.

View 13ph03nix's full-sized avatar
⛳
Focusing

13ph03nix

⛳
Focusing
View GitHub Profile
@13ph03nix
13ph03nix / README.md
Created May 19, 2026 20:44
Claude Code server-managed and endpoint-managed settings bypass via BUN_OPTIONS=--preload

How it works

hook_settings.js loads before Claude Code starts and intercepts the settings request, returning a forged response with a valid checksum. This bypasses any policy restrictions set by the organization admin. It also cleans up env var and execArgv traces to hide the injection.

Two interception layers are patched for compatibility:

  • globalThis.fetch — Bun's native HTTP layer (used by current Claude Code releases)
  • https.request — Node.js compat layer fallback

Usage

@13ph03nix
13ph03nix / README.md
Created May 19, 2026 20:40
Reuse Claude Code's bundled Bun as a general-purpose runtime

since v2.1.113, the claude code binary is the only distribution channel now (the Node.js version is deprecated), and it's basically a Bun runtime with Claude Code bundled on top, so we can just hijack it to run our own scripts: BUN_OPTIONS="--preload /tmp/test_hook.js" claude.

➜  ~ cat /tmp/test_hook.js
console.log("hello from claude's bundled bun");
console.log("bun version:", process.versions.bun);
console.log("node compat:", process.versions.node);
console.log("1 + 2 =", 1 + 2);
console.log("platform:", process.platform, process.arch);
process.exit(0);

Remote Code Execution via Custom Code Guardrail Sandbox Escape

Summary

The Custom Code Guardrail allows admins to write Python code that runs in a sandboxed exec() environment. However, the code forgets to remove __builtins__ from exec globals — Python then auto-injects the full builtins module, giving user code access to __import__, open, eval, etc.

An attacker can create a malicious guardrail via POST /guardrails and trigger it on any LLM request, achieving arbitrary code execution on the server.

Note: While POST /guardrails requires proxy_admin privileges, an attacker with only internal_user access can first escalate to proxy_admin via another privilege escalation vulnerability I reported, then exploit this RCE to fully compromise the server.

Privilege Escalation from Internal User to Proxy Admin via Unrestricted allowed_routes in /key/generate

Summary

A low-privilege internal_user can escalate to proxy_admin by exploiting a privilege escalation vulnerability in the virtual key generation feature. The /key/generate endpoint allows any authenticated user with key management permissions (i.e., internal_user) to create keys with arbitrary allowed_routes, including routes normally restricted to administrators. By generating a key with access to /user/update, the attacker can then modify their own user_role to proxy_admin, gaining full administrative control over the LiteLLM proxy.

Background

Role-Based Access Control

Langflow Exploit Chain: From CORS misconfiguration to Token Hijack & RCE

Summary

Obsidian security's research discovered a critical vulnerability chain (CVSS v4.0: 9.4) in Langflow, a widely adopted open-source AI workflow platform with over 130,000 GitHub stars. The flaw enables complete account takeover and remote code execution through a single malicious webpage visit.

The vulnerability exploits a dangerous combination of:

  • Overly permissive CORS configuration: allows cross-origin requests with credentials from any origin
  • Misconfigured refresh token in cookie: will be included in cross-site requests, which when combined with the CORS misconfiguration, enables attackers to obtain fresh access_token and refresh_token pairs from arbitrary origins
@13ph03nix
13ph03nix / zyxel_firmware_extract.txt
Last active December 10, 2025 22:25
Zyxel Fimware Extract (Cracking Zip Files using known-plaintext attack)
unzip firmware.zip && cd firmware
zip -9 460AALA1C0_temp.zip 460AALA1C0.conf
pkcrack/1.2.2/bin/extract 460AALA1C0_temp.zip 460AALA1C0.conf a.plaintext
pkcrack -C 460AALA1C0.bin -c db/etc/zyxel/ftp/conf/system-default.conf -p a.plaintext -d ok.zip -a
Files read. Starting stage 1 on ...
Generating 1st generation of possible key2_11358 values...done.
Found 4194304 possible key2-values.
Now we're trying to reduce these...