Skip to content
Access control Disclosed report Intermediate CVE-2023-30586

OpenSSL engines can be used to bypass and/or disable the permission model

The Node.js permission model allowed loading arbitrary OpenSSL engines even when native addons were disallowed, so code could run outside the model's restrictions. An attacker could use this to bypass or disable the permission model and escalate privileges.

tniessen Follow

Originally disclosed on HackerOne

Medium 6.3 View original
  • Disclosed after 2 months

Summary: Node.js 20 allows loading arbitrary OpenSSL engines even when the permission model is enabled, which can bypass and/or disable the permission model.

Description: The permission model implementation permits loading arbitrary native code, e.g., through crypto.setEngine(), even when native addons are disallowed, which is the default configuration. Not only can this code bypass the permission system, it can also disable the permission system entirely, effectively allowing JavaScript code to escalate its own privileges.

Steps To Reproduce:

  1. Enable the permission model.
  2. Call, for example, crypto.setEngine() with a compatible OpenSSL engine.
  3. Arbitrary code execution occurs, unaffected by the permission model.

Impact

The permission model is supposed to restrict the capabilities of running code. However, exploiting this vulnerability allows an attacker to easily bypass the permission model entirely. The OpenSSL engine can, for example, disable the permission model in the host process, and subsequently executed JavaScript code will be unaffected by the previously enabled permission model. This allows running JavaScript code to effectively elevate its own permissions.

The original report as published on HackerOne, by tniessen. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the permission model did not block the loading of native OpenSSL engines through crypto.setEngine(), even though native addons were disallowed by default.

Impact

An attacker could bypass or disable the permission model entirely, allowing running JavaScript code to elevate its own permissions.

What the attacker needed

Permission model enabled; ability to call crypto.setEngine(); a compatible OpenSSL engine

How it was found

  1. Enable the permission model.
  2. Call crypto.setEngine() with a compatible OpenSSL engine.
  3. Arbitrary code execution occurs, unaffected by the permission model.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The permission model is a Node.js feature meant to limit what running code can do. This report found that a function for loading OpenSSL engines could still load native code, which runs outside those limits. That native code could then turn off the permission model, letting the JavaScript do more than it should.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by tniessen

View all

15 more disclosed reports, best first.

More from Node.js

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.