waha icon indicating copy to clipboard operation
waha copied to clipboard

[💵 Bug Bounty] 2K USDT - Security Alert - Waha API Abuse Detected

Open vscarabel opened this issue 1 year ago • 27 comments

💵 Bug Bounty: We're offering 2,000 USDT to anyone who can demonstrate a valid security vulnerability or exploit in WAHA Plus, when a strong WHATSAPP_API_KEY is properly set.

If you believe you've found a potential issue, please report it privately so we can verify and address it responsibly.
📧 Contact: [email protected]


Security Alert - Waha API Abuse Detected

(English)

Summary: 24 hours after installing the Waha API, the server began sending scam messages automatically to phone numbers in Brazil without authorization.

Details: After reviewing the server logs, it was confirmed that the scam messages were triggered by remote requests initiated after the Waha installation. The server is private, has no public endpoints, and no other software was added — strongly suggesting the existence of a backdoor intentionally left by the Waha developers.

This backdoor appears to allow remote third-party control of the WhatsApp instance connected through Waha, enabling unauthorized use for spam and scam distribution.

Consequences: • WhatsApp detected the activity and banned the connected account. • There is a high risk of further abuse or legal consequences if the API remains active. • Trust and data security are compromised.

Recommendation: • Immediately uninstall Waha and revoke all related tokens or access points. • Inspect your server for suspicious activity or scripts. • Do not use third-party APIs without full source code audit or security review.

⸝

⚠️ Alerta de Segurança - Abuso Detectado com a Waha API

(PortuguĂŞs)

Resumo: 24 horas após a instalação da Waha API, o servidor começou a enviar mensagens de golpe automaticamente para números no Brasil, sem qualquer autorização.

Detalhes: A análise dos logs do servidor confirmou que os envios foram feitos via requisições remotas iniciadas após a instalação do Waha. O servidor é privado, sem endpoints públicos, e não houve outras instalações — indicando fortemente a presença de um backdoor deixado intencionalmente pelos desenvolvedores do Waha.

Esse backdoor parece permitir o controle remoto da instância do WhatsApp conectada via Waha, sendo usada de forma indevida para distribuição de spam e golpes.

Consequências: • O WhatsApp identificou a atividade e baniu a conta conectada. • Há risco elevado de novos abusos ou consequências legais se a API continuar ativa. • A segurança e confiança do sistema foram comprometidas.

Recomendação: • Desinstale imediatamente o Waha e revogue todos os tokens e acessos associados. • Verifique seu servidor em busca de scripts ou acessos suspeitos. • Evite o uso de APIs de terceiros sem auditoria completa de código e segurança.

vscarabel avatar Jun 19 '25 10:06 vscarabel

@vscarabel how you define the server is private and no public endpoint?

There is security alert in reddit that someone is targeting unsecured waha instance, no evidence provided in the issues and just your pov

patron:PRO

glendonyeo avatar Jun 19 '25 10:06 glendonyeo

@glendonyeo it’s running localhost

vscarabel avatar Jun 19 '25 10:06 vscarabel

@vscarabel what about this? if its installed localhost supposingly no remote request will be allowed. unless the request is from the docker instance itself, any thing that can prove the incident?

After reviewing the server logs, it was confirmed that the scam messages were triggered by remote requests initiated after the Waha installation

patron:PRO

glendonyeo avatar Jun 19 '25 10:06 glendonyeo

Image

Image

vscarabel avatar Jun 19 '25 11:06 vscarabel

All scam sent via Waha

vscarabel avatar Jun 19 '25 11:06 vscarabel

@glendonyeo Thats exactly the point. The only way to have access to that machine is a back door

vscarabel avatar Jun 19 '25 11:06 vscarabel

@glendonyeo Thats exactly the point. The only way to have access to that machine is a back door

@vscarabel would he great if you are able to provide the server logs you mentioned

patron:PRO

glendonyeo avatar Jun 19 '25 11:06 glendonyeo

I’m experiencing a very similar situation, and I want to share my case to help clarify the scope of this issue.

I’ve been using WAHA API for some time, with multiple sessions running in isolated Docker containers on Raspberry Pi devices. All sessions were protected with high-entropy 58-character API keys, and the API was only exposed on a high, non-standard port (>40,000). I work alone, so the possibility of human error or credential leakage is extremely unlikely.

Incident timeline:

Two of my WhatsApp sessions were suspended by WhatsApp without any message activity.

A third session (in development mode) was suddenly overwhelmed with dozens of outgoing messages to Brazilian numbers, all spam or scam, which caused WhatsApp to immediately block the number.

A fourth session, which remained idle, also received a suspicious message from Brazil and was manually shut down to avoid further damage. This was one of the messages

⚠️ ATENÇÃO ⚠️

CONFIRMAÇÃO FINAL DE ENTREGA

OlĂĄ, Domingo Messias Alves de Souza, Tudo bem ?

Confirmamos o pagamento do produto Xiaomi Redmi Note 14 Pro 5g 12RAM 512gb (Xiaomi Redmi Note 14 Pro 5g 12RAM 512gb) no valor de R$ 118,37.

Agora, falta apenas quitar a Taxa Final de Entrega no valor de R$ 24,90 para liberar o envio.

Libere seu pedido agora: https://global.klivopay.com.br/fdq9kayewn

Dados do Pedido: • Nome: Domingo Messias Alves de Souza • Telefone: 5527999605640 • E-mail: [email protected] • CPF: 8559746722 • Produto: Xiaomi Redmi Note 14 Pro 5g 12RAM 512gb (Xiaomi Redmi Note 14 Pro 5g 12RAM 512gb) • Valor: R$ 118,37

Entrega em atÊ 2 dias úteis após confirmação.

Libere seu pedido agora: https://global.klivopay.com.br/fdq9kayewn

After this incident, and to further harden the setup, with 2 new phone numbers, I placed WAHA entirely behind a VPN, with no exposed ports. It only “talked” to the endpoint over a local network with no external access. Despite this, during the early morning hours, two more WhatsApp numbers were suspended — again, without any outbound activity initiated by me. At first, I thought it was a targeted attack, but after reading your report, it clearly matches the same pattern — including the unauthorized use of my session to send scam messages.

This is an extremely serious security breach, and I strongly suspect some kind of backdoor or remote execution vector. If there’s any way to collaborate or provide more logs to investigate this, I’m available.

Interspock avatar Jun 20 '25 13:06 Interspock

@interspock This was exactly what happened to me. I tested today in a different isolated server and the same happened again. I then forwarded all the logs to Meta (WhatsApp Business) to investigate.

Image

vscarabel avatar Jun 20 '25 19:06 vscarabel

Checking the logs, the waha is being controlled remotely by ip 212.85.6.164 based in Brazil.

vscarabel avatar Jun 20 '25 19:06 vscarabel

@vscarabel Thanks for confirming — this matches exactly what I experienced as well.

Would you mind letting me know where in the logs you found the reference to the remote IP (212.85.6.164)? I’d like to check my own instances and share any matching evidence to support the investigation.

That said, given the impossibility of this happening from the outside — considering that all requests require an API key with very high entropy, and the instance is placed behind a firewall and within a VPN — I have no choice but to suspect that there is malicious code enabling remote execution within the WAHA instance itself.

For context, I am a WAHA Plus paid subscriber, and this issue has affected all sessions running inside the same instance.

Appreciate your help.

Interspock avatar Jun 20 '25 20:06 Interspock

Hi!

Just to clarify — there's no backdoor from the WAHA team. You can inspect the source code yourself:

In most of the cases we’ve seen, users either:

  • unintentionally exposed the WAHA Core API publicly, or
  • used WAHA Plus but set WAHA_API_KEY instead of WHATSAPP_API_KEY.

Please refer to the security guide:
👉 https://waha.devlike.pro/docs/how-to/security/

We're building the Docker image from scratch in CI, so it should be safe.

Connecting to a WAHA instance from outside (assuming only port 22 is open via firewall) would be very difficult. It would require injecting a script that connects to a bot server and waits for commands — not something easy or profitable enough to be worth the effort.

That said, I still suspect some malformed HTTP request might be exposing the WHATSAPP_API_KEY or .env unintentionally, but I haven’t found a reproducible way to confirm this yet.


@vscarabel

The server is private, has no public endpoints

Could you share your docker-compose.yml or the command used to run the server?


@Interspock
Could you also share your Docker config or docker-compose.yml (feel free to omit any secrets like keys)?


💵 Bug Bounty:
We're offering 2,000 USDT to anyone who can demonstrate a valid security vulnerability or exploit in WAHA Plus, when a strong WHATSAPP_API_KEY is properly set.

If you believe you've found a potential issue, please report it privately so we can verify and address it responsibly.
📧 Contact: [email protected]

patron:PRO

devlikepro avatar Jun 21 '25 08:06 devlikepro

The server is private, has no public endpoints

If you run it using https://waha.devlike.pro/docs/how-to/install/ - it exposes 3000 port outside.

so would love to hear about your setup more

patron:PRO

devlikepro avatar Jun 21 '25 08:06 devlikepro

forwarded all the logs to Meta (WhatsApp Business)

Hah 😱

patron:PRO

devlikepro avatar Jun 21 '25 09:06 devlikepro

@devlikepro

Hi, thanks for the clarification.

For testing purposes, I deliberately deployed a WAHA instance on a server located in China (Alibaba). This instance was intentionally exposed to the internet with a random high port, and logging was enabled for both inbound and outbound traffic.

Here’s what happened: • The instance was not scanned, connected to, or initialized in any way (I hadn’t even scanned the QR code yet). • Despite that, within 10 minutes of going online, attack attempts began — originating specifically from IPs geolocated in Brazil. • These attempts were not generic scans, but targeted HTTP requests towards endpoints WAHA typically exposes (e.g., /sessions, /instance, etc.).

This leads to an important observation:

It would have been impossible for an external attacker to know the IP and random port of the service unless that information was leaked or broadcasted in some way.

Given that: • No DNS entries or public exposure mechanisms were used. • The port was non-standard and randomly selected. • The instance wasn’t initialized (i.e., it wasn’t “phoning home” or establishing any outbound connections on its own), • The only common element was running the WAHA container image as-is.

This raises two concerns: 1. Possible fingerprinting or beaconing: even without scanning the QR code, some background process (perhaps inside the container or one of its dependencies) may be contacting a third-party service or CDN that correlates instance IPs. 2. Public image-level exposure: the image might be “leaking” metadata through an HTTP request, crash report, or update ping — possibly embedding host IP/port unintentionally.

While I appreciate the transparency and the CI-based build process, I suggest considering: • A full review of network activity from a clean container, before QR scan or session creation. • Enabling strict egress control during the initialization phase to verify if any unexpected outbound traffic occurs. • Validating whether any included dependency (such as a Node.js package) might be acting as a tracking vector.

Also worth mentioning: such behavior (attacks from Brazil on a Chinese IP within minutes) strongly indicates automated monitoring of newly instantiated WAHA-like servers, potentially via leaked metadata or exposed registry

vscarabel avatar Jun 22 '25 09:06 vscarabel

Great work, @vscarabel — I was planning to open a tcpdump / packet capturing myself to detect any anomalous behavior like the one you clearly describe in your report. But your idea to test from a server in China using a random port was better and brilliant — "placing the flowers far away to see if the bees arrive."

This isn’t about assigning blame, but about finding the source of what’s happening — for the benefit of everyone. Because clearly, it is happening.

In my case, a fully isolated container — with no exposed ports, running in a private LAN — was also compromised. (This photo I shared show one of the two WhatsApp accounts after being unbanned.)

Image

I honestly can’t imagine how an instance behind a firewall could be reached unless some outbound tunnel is being established. If I’m wrong, I’d sincerely appreciate anyone correcting me.

That’s why I believe it’s entirely possible that a dependency is compromised.

To help mitigate this, let me ask: Could a possible solution be to use only randomized route names/endpoints to the outside via a reverse proxy, mapping them internally through a translation table to the actual paths? Would that add a real layer of protection? Or would an internal execution vector bypass this mechanism entirely?

Thanks

Interspock avatar Jun 22 '25 14:06 Interspock

@vscarabel @Interspock

I would like to double confirm whether you are using official image and which version you are using, and the image not via third party or anywhere suspicious

I have deployed multiple instance, and so far i did not receive any weird traffic, and yes my instance expose to public

docker itself doesn't expose who download the image either, its really interesting that how your private instance leaked

As a Waha user who run in production, i am interested to know whats happened behind, would be appreciate more information can be provided, if this issues is happened to new instance spawned, by right most of the user impact by this vulnerability

I have do a quick scan towards the source code and far didn't found any suspicious code, creating a honeypot should be the fastest thing we can locate the root issues.

if this is the case, i would suggest you spawn a new instance, and use a firewall, or other network devices which log all the incoming and outgoing traffic so you have an idea who initiate the request that leadings to session / credentials leak

patron:PRO

glendonyeo avatar Jun 22 '25 15:06 glendonyeo

@vscarabel @Interspock could you share your logs and other finding please? You can do it privately - [email protected]

@glendonyeo yeah, super weird, we're investigating it and will add one more protection layer in the next release 🤞

patron:PRO

devlikepro avatar Jun 23 '25 10:06 devlikepro

@vscarabel @Interspock

I would like to double confirm whether you are using official image and which version you are using, and the image not via third party or anywhere suspicious

Absolutely! I always pull the latest official image as soon as it's released and announced.

Interspock avatar Jun 23 '25 14:06 Interspock

@vscarabel @Interspock could you share your logs and other finding please? You can do it privately - [email protected]

Yes, I'm exporting it now and I'll send it to you (at least from the latest hack).

@glendonyeo yeah, super weird, we're investigating it and will add one more protection layer in the next release 🤞

It would be ideal to have a validation mechanism based on an IP whitelist, allowing only those addresses to access the API routes. In my case, I regenerated the API key using a 128-byte value and placed the instance behind a reverse proxy configured with that IP-based access control. So I hope (fingers crossed) it won’t happen again.

Interspock avatar Jun 23 '25 14:06 Interspock