Browser extension reverse

From oyi77/1ai-skills · View interactive version

Browser extension reverse is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when reverse engineer browser extensions: unpack CRX/XPIs or load unpacked directories, audit manifest permissions for overreach, trace content and background script data flows, extract API endpoints and storage keys, and detect malicious or data-exfiltrating behavior. Use when analyzing extensi

How to use this skill

Skill file

Browser Extension Reverse Engineering

Overview

Browser extensions (Chrome/Edge MV2/MV3, Firefox) run with privileges a web

page does not have: cross-origin requests, webRequest interception, storage

access, and native messaging. That elevated trust makes them a high-value

target for both attackers (malicious extensions, supply-chain poisoning of

popular extensions) and defenders (credential or traffic logic recovery).

This skill covers the full extension analysis workflow: package acquisition,

manifest permission audit, content/background script tracing, dynamic

loading in developer mode, and the data-flow reconstruction that ties it

together. Complex obfuscated inner logic routes into the general JavaScript

workflow (js-reverse); poisoning investigations route into supply-chain

and malware analysis.

Source: cherry-picked and translated from zhaoxuya520/reverse-skill

(skills/browser-extension-reverse, MIT license); reference notes

(extension-analysis.md) inlined.

When to Use

Trigger phrases:

Use this skill when:

plain web page — plain page JS routes to js-reverse.

or determine whether it exfiltrates data.

Prerequisites

Workflow

Phase 1: Package

directory out of the browser profile.

background/service_worker, content_scripts.

below).

Phase 2: Logic

content_script injection points and their worlds (isolated vs main).

encrypted configuration blobs.

chrome.runtime.onMessage) exactly as in js-reverse: watch what the

extension sends, when, and to where.

Phase 3: Dynamic

chrome://extensions for errors.

instrument the worker at runtime.

Phase 4: Data Flow Reconstruction

bodies) to its sink (network call, native messaging port, storage write).

legitimate use.

Manifest Risk Signals

| Field | Risk signal |

|---|---|

| host_permissions <all_urls> | Can read/write any site |

| webRequestBlocking | Man-in-the-middle style rewriting of traffic |

| nativeMessaging | Escapes the browser to the host machine |

| externally_connectable | Web pages can drive the extension |

MV3 specifics: audit the service_worker lifecycle and

declarativeNetRequest rules — static/dynamic rules are a common covert

traffic-modification surface.

Hands-On Example

Before reading the bundle, unpack a CRX and run Mozilla's linter over it —

npx web-ext lint (verified: resolves web-ext 10.6.0 from npm):

mkdir -p /tmp/ext && unzip -q sample.crx -d /tmp/ext
npx web-ext lint --source-dir /tmp/ext

The lint report surfaces permission misuse, remote-code hazards, and MV3

migration issues that map directly to the Manifest Risk Signals table — a

cheap first pass (Phase 1 — Package) that tells you where to look before the

static scan of the bundle.

Verification

Run this self-check before claiming completion:

with observed evidence for each hop.

explicitly ruled out with evidence.

artifacts that support it.

When NOT to Use

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "The manifest looks minimal, so it's safe." | Minimal permissions can still be abused; content scripts and DNR rules are invisible in the permission list. Read the code. |

| "I'll just read the background script." | The interesting flow usually lives across content script → messages → worker → network. Trace the whole path. |

| "Dynamic analysis is unnecessary." | Static reading misses runtime-injected URLs, dynamically constructed endpoints, and obfuscated handlers. Load it in developer mode. |

| "It's from the official store, so it's clean." | Store review has been bypassed repeatedly; supply-chain attacks land in stores. Treat the package as untrusted input. |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.