Overview
This video describes scanning VS Code extensions for exposed source code, and a report that went unanswered (the issue has since been fixed). It was inspired by an article about GitHub rewarding a report that its Copilot extension shipped its source code. Extensions are distributed as compressed .vsix files, and if TypeScript’s inlineSources option is true, the original source ends up in the build output.
Key Points
- The scanner, built with AI coding tools such as Claude Code, took company names from the HackerOne API, searched the VS Code Marketplace API for them, then downloaded and unpacked each extension to extract embedded source maps.
- About 3,000 extensions were scanned and 160 flagged, but many were open source (such as Python Debugger), so extensions linking to a GitHub or GitLab repository were skipped. Noisy company-name search was later replaced by scanning the most-installed extensions.
- Of about ten hits, roughly three mattered, and about one really contained a company’s full proprietary extension code.
- With no security contact listed, the author used a customer contact form to ask for the security team, got its email address a few days later and reported, but heard nothing for about two months. A later rescan showed the exposure was gone.
- Follow-ups: trufflehog finds tokens and secret keys by known formats and can check whether a key works. It found nothing here, and false positives such as test credentials need human review. Chrome extensions covered by Google’s own reward program were scanned too, with no findings.
Chapters
- 0:00 Introduction
- 0:28 What prompted the investigation
- 1:37 Targets: the HackerOne company list
- 3:21 Collecting VS Code extensions
- 4:23 Scan results
- 5:27 Collecting non-OSS extensions
- 8:00 How the report was made
- 8:55 Ignored
- 9:49 Scanning with trufflehog
- 12:24 Investigating Chrome extensions too
概要
この動画では、VS Code拡張にソースコードが露出していないかをスキャンし、見つけた問題を報告したものの返信がなかった経緯を紹介します(問題はすでに修正されています)。きっかけは、GitHubのCopilot拡張にソースコードが含まれていたことを報告し、GitHubから報奨金を受け取ったという記事でした。拡張は圧縮された.vsixファイルで配布されており、TypeScriptのinlineSourcesをtrueにしていると、元のソースコードがビルド成果物に含まれてしまいます。
ポイント
- Claude CodeなどのAIコーディングツールで作ったスキャナーは、HackerOneのAPIから企業名を取得し、VS Code MarketplaceのAPIでそれを検索し、見つかった拡張をダウンロード、展開して、含まれているソースマップを取り出します。
- 約3000件をスキャンして160件が該当しましたが、Python Debuggerのようにオープンソースのものが多かったため、GitHubやGitLabのリポジトリへのリンクがある拡張は対象外にしました。精度の低い企業名での検索は、のちにインストール数の多い拡張をスキャンする方式に切り替えました。
- 見つかった10件ほどのうち、重要なのは3件ほどで、企業の非公開の拡張コードが丸ごと含まれていたのは1件ほどでした。
- セキュリティの窓口が見当たらなかったため、筆者は問い合わせフォームからセキュリティチームへの取り次ぎを頼み、数日後に教えてもらったメールアドレスに報告しましたが、2か月ほど返信はありませんでした。のちに再スキャンすると、露出はなくなっていました。
- 発展編として、既知の形式からトークンやシークレットキーを探し、キーが有効かどうかも確かめられるtrufflehogを使いました。今回は何も見つからず、テスト用の認証情報のような誤検知もあるため、人間による確認が欠かせません。Googleが独自に運営する報奨金プログラムの対象のChrome拡張もスキャンしましたが、何も見つかりませんでした。