Skip to content
Access control Write-up Intermediate

Dahua IP Camera P2P Authentication Bypass

Attackers exploited predictable Dahua camera serial numbers and two old login-bypass flaws to reach cameras through the P2P cloud relay or port 37777 without a password. They could view video, change settings and create a hidden backdoor account that survives a password change and, on most firmware, a factory reset.

TEJAS Follow

Published on tsaubhage0007.medium.com

Normally, to watch your camera from your phone, you would need to know your home’s internet address and open a door in your router. That is hard for most people.

TEJAS, on tsaubhage0007.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the P2P relay trusts a guessable serial number as sufficient to reach a device, and old firmware contains authentication-bypass flaws that skip the password check.

Impact

Attackers could watch video streams, change device settings and create hidden accounts, including a backdoor that survives a password change and, on most firmware, a factory reset.

What the attacker needed

Dahua camera or compatible brand; old firmware; P2P enabled or port 37777 exposed; weak or default password

The fix

Dahua's 2021 security advisory SA-2021-0130 should be applied, P2P should be disabled if not needed, port 37777 should be blocked from the internet, and strong passwords should be used.

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 write-up has not been written yet. The Original tab links to the source.

A camera's serial number is meant to be a unique name, not a secret password. Because Dahua serial numbers follow a predictable pattern, attackers can guess them and use a cloud service to connect to cameras. Two old software bugs also let attackers skip the login check entirely on outdated firmware.

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 TEJAS

View all

1 more disclosed report, best first.

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.