Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AdsPower Supply-Chain Vulnerability Analysis

中文版本 / Chinese Version

Overview

This repository documents the technical analysis and local reproduction of the January 2025 AdsPower supply-chain attack. The vulnerability originated in the SaleSmartly live-chat platform and propagated through a storage bucket misconfiguration to compromise AdsPower's Electron-based browser, affecting thousands of users.

Disclaimer: This project is for educational and defensive security research purposes only. The reproduction environment uses MITM interception on localhost to demonstrate the attack vector. Do not use these techniques against systems you do not own or have authorization to test.

Public References

Vulnerability Chain (Technical Breakdown)

  1. Entry point: SaleSmartly's live-chat widget exposes a file upload endpoint with client-side encryption
  2. Encryption bypass: Frontend JS reversing reveals Alibaba Cloud OSS upload policy credentials
  3. Path traversal: Upload function allows cross-path overwrites on the storage bucket
  4. Asset discovery: Traffic analysis maps storage bucket domains to SaleSmartly-owned infrastructure
  5. JavaScript injection: Overwritten JS files are served to all clients loading from the compromised bucket
  6. AdsPower dependency: AdsPower's Electron shell loads external JS resources during its splash/startup phase without integrity verification
  7. Code execution: Injected Node.js payload executes with full Electron privileges on the client machine
  8. Extension hijacking: AdsPower's built-in wallet management RPC allows silent extension replacement without user confirmation

Key Findings

  • Root cause: No subresource integrity (SRI) checks on externally loaded JavaScript during application startup
  • Amplification factor: Single storage bucket compromise propagated to all AdsPower installations loading from that CDN
  • Impact: Browser extension wallets (MetaMask, OKX Wallet) exposed to credential extraction via Electron's Node.js integration

Local Reproduction (Windows)

This setup uses a local MITM proxy to simulate the supply-chain injection in an isolated environment.

Prerequisites

  • Python 3.x
  • mitmproxy
  • Proxifier (download from official site)
  • A local AdsPower installation (test instance)

1. Start the callback server

cd scripts
py -3 callback_server.py

2. Set up MITM interception

a. Install mitmproxy

py -3 -m pip install pipx mitmproxy
py -3 -m pipx install mitmproxy
py -3 -m pipx ensurepath

b. Start the injection proxy

cd scripts
mitmproxy -s mitm_injector.py -p 8888

c. Install mitmproxy CA certificates from C:\Users\{username}\.mitmproxy:

  • mitmproxy-ca.p12
  • mitmproxy-ca-certs.cer
  • mitmproxy-ca-cert.p12

d. Install and configure Proxifier (download from official site)

Set up proxy server (127.0.0.1:8888):

Route AdsPower traffic through the proxy:

3. Launch AdsPower

When AdsPower starts, it loads the intercepted JS, demonstrating the injection vector. The callback server logs the connection, confirming code execution.

Mitigations

For Electron-based applications loading remote resources:

  1. Implement Subresource Integrity (SRI) for all external scripts
  2. Pin expected content hashes for startup-phase resources
  3. Disable Node.js integration in renderer processes where not required
  4. Validate extension installations against a signed manifest
  5. Enforce Content Security Policy (CSP) headers on all loaded origins

License

MIT

Releases

Packages

Contributors

Languages