Prototype Pollution Vulnerability in noble Package
The noble Node.js Bluetooth Low Energy module exposes a method that lets an attacker inject arbitrary properties onto Object.prototype. The reporter suspects the values could be controlled remotely over Bluetooth, but only demonstrated a local call.
Originally disclosed on HackerOne
- Disclosed after 2.9 years
I would like to report prototype pollution vulnerability in noble. It allows attackers to pollute the Object.prototype object of an application running noble, possibly through Bluetooth.
Module
module name: noble
version: 1.9.1
npm page: https://www.npmjs.com/package/noble
Module Description
A Node.js BLE (Bluetooth Low Energy) central module. Want to implement a peripheral? Checkout bleno Note: macOS / Mac OS X, Linux, FreeBSD and Windows are currently the only supported OSes. Other platforms may be developed later on.
Module Stats
2,270 downloads in the last week
Vulnerability
Vulnerability Description
An attacker can inject arbitrary properties on Object.prototype using one of the methods exposed by this module. Moreover, there is strong evidence (parameter names) to believe that these values can be controlled remotely by the attacker, through Bluetooth.
Steps To Reproduce:
For now, I only have a local payload, but it seems to me that both the peripheralUuid and serviceUuids, expected by the onServicesDiscover are specified in the Bluetooth standard, thus it may come from another device advertising itself over Bluetooth. However, this scenario needs to be investigated further.
var noble = require('noble');
//noble.emit("servicesDiscover");
console.log({}.x);
try {
noble.onServicesDiscover("__proto__", "x");
} catch(e) {}
console.log({}.x);
Patch
N/A validate the property name or initialize the target object using Object.create(null).
Wrap up
- I contacted the maintainer to let them know: N
- I opened an issue in the related repository: N
Impact
If the attack can indeed by deployed using Bluetooth, this issue is serious, allowing the attacker to inject arbitrary properties from a remote device.
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 onServicesDiscover method assigns attacker-controlled property names directly onto an object without validating them, allowing the special __proto__ key to modify Object.prototype.
Impact
If the attack can be deployed over Bluetooth, a remote device could inject arbitrary properties into the application, which the reporter calls serious; this remote scenario is not yet proven.
What the attacker needed
Application uses noble 1.9.1; attacker can influence onServicesDiscover arguments; remote Bluetooth control is unproven
How it was found
- Load the noble module in a Node.js script.
- Call noble.onServicesDiscover with a prototype-polluting property name and a value.
- Observe that a plain object now has the injected property.
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.
Prototype pollution is a flaw where an attacker can add or change default properties that every object in a JavaScript program inherits. Here, calling a function in the noble Bluetooth library with a special property name changes the shared prototype, so other parts of the program may behave unexpectedly. The report only shows this happening locally, not yet over Bluetooth.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.