Skip to content

Enhance stealth about Object.prototype.hasOwnProperty.call of XMLHttpRequest related scriptlets #4089

Description

@piquark6046

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

const Req = new XMLHttpRequest()
Req.open('OPTIONS', 'https://example.com')
Req.send()

const CleanReq = new XMLHttpRequest()

const Properties = ['status', 'statusText', 'readyState', 'response', 'responseURL', 'responseXML', 'setRequestHeader'] as const
Properties.forEach(Key => {
    // 'call' indicates Function.prototype.call
  console.log(`Object.prototype.hasOwnProperty.call(Req, ${Key})`, Object.prototype.hasOwnProperty.call(Req, Key))
  console.log(`Compares XMLHttpReqeust.prototype with clean one ${Key}`, Req[Key] === CleanReq[Key])
})
const Properties = ['status', 'statusText', 'readyState', 'response', 'responseURL', 'responseXML', 'setRequestHeader'] as const

const Req = new XMLHttpRequest()
Req.timeout = 1000
Req.onerror = () => { Func() }
Req.onabort = () => {}
Req.onload = () => { Func() }
Req.ontimeout = () => {}
Req.open('OPTIONS', 'https://example.com/', true)
Req.send()

const CleanReq = new XMLHttpRequest()

function Func() {
  Properties.forEach(Key => {
    // 'call' indicates Function.prototype.call
    console.log(`Object.prototype.hasOwnProperty.call(Req, ${Key})`, Object.prototype.hasOwnProperty.call(Req, Key))
    console.log(`Compares XMLHttpReqeust.prototype with clean one ${Key}`, Req[Key] === CleanReq[Key])
  })
}

Related to uBlockOrigin/uAssets#34177

A specific URL where the issue occurs.

`https://chzzk.naver.com/video/14745879` (should be logged in with a Naver account)

Steps to Reproduce

  1. Add example.com##+js(no-xhr-if, 'example.com method:OPTIONS')
  2. Visit https://example.com
  3. Execute the above Typescript code.
  4. Disable the added filter and reload the webpage.
  5. Execute once again.
  6. Compares between each results.

Expected behavior

Same between the execution results.

Troubleshooting information

uBlock Origin: 1.73.0
Firefox: 155
filterset (summary):
 network: 183066
 cosmetic: 46530
 scriptlet: 34820
 html: 3780
listset (total-discarded, last-updated):
 added:
  KOR-1: 4749-86, 1h.36m
 default:
  user-filters: 0-0, never
  ublock-filters: 53938-72, 1h.36m
  ublock-badware: 10189-17, 1h.36m
  ublock-privacy: 4110-2, 1m Δ
  ublock-unbreak: 2865-1, 1h.36m
  ublock-quick-fixes: 501-13, 43m Δ
  easylist: 85926-139, 43m Δ
  easyprivacy: 56385-43, 43m Δ
  urlhaus-1: 47560-6, 1h.36m
  plowe-0: 3526-1044, 6d.20h.12m
filterset (user): [empty]
userSettings:
 userFiltersTrusted: true
hiddenSettings: [none]
supportStats:
 allReadyAfter: 510 ms
 maxAssetCacheWait: 283 ms
 cacheBackend: indexedDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions