Skip to content
RCE Disclosed report Advanced CVE-2022-43548

DNS rebinding in --inspect via invalid octal IP address

The Node.js --inspect DNS rebinding protector fails to block invalid octal IP addresses like [redacted], which browsers such as Firefox still resolve via DNS. An attacker can use this to perform DNS rebinding and execute arbitrary code when a developer has an active --inspect session.

haxatron1 Follow

Originally disclosed on HackerOne

Medium 6.8 View original
  • Triaged in 4 days
  • Fixed in 45 days
  • Disclosed after 2 months

Summary

The Node.js rebinding protector for --inspect still allows invalid IP address, specifically, the octal format. An example of an octal IP address is 1.09.0.0, the 09 octet is invalid because 9 is not a number in the base 8 number system. Browsers such as Firefox (tested on latest version m105) will still attempt to resolve this invalid octal address via DNS. When combined with an active --inspect session, such as when using VSCode, an attacker can perform DNS rebinding and execute arbitrary code

Steps To Reproduce:

  1. Add entry to /etc/hosts
127.0.0.1       1.09.0.0
  1. Start node --inspect
  2. Visit http://1.09.0.0:9229/json on Firefox (tested on m105)
  3. JSON file shows. This proves Firefox is resolving 1.09.0.0 to 127.0.0.1 via DNS. Additionally, you may use Wireshark to see that Firefox is sending DNS requests to 1.09.0.0 (without the /etc/hosts entry of course!)

Impact

Bypass the DNS rebinding protection for --inspect and execute arbitrary code

The original report as published on HackerOne, by haxatron1. 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 DNS rebinding protection only checks for standard IPv4 formats and does not account for octal or other non-standard IP representations that browsers still resolve.

Impact

Bypass the DNS rebinding protection for --inspect and execute arbitrary code.

What the attacker needed

Node.js running with --inspect; Victim uses a browser that resolves octal IPs; Attacker can lure victim to a malicious page

How it was found

  1. Add an entry to the hosts file mapping [redacted] to 127.0.0.1.
  2. Start Node.js with the --inspect flag.
  3. Visit the debug endpoint using the octal IP address in Firefox.
  4. Observe that the JSON response is returned, proving Firefox resolved the octal address to localhost.

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.

When you run Node.js with --inspect, it opens a debugging port meant to be local only. A protection checks the address and blocks non-localhost, but it misses octal addresses like [redacted] that browsers still resolve via DNS. An attacker can use this to perform DNS rebinding and run code on your machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by haxatron1

View all

30 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.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.