Skip to content

Adsbygoogle.js injectable does not validate whether iframe going to be injected is already exist or not #786

@mmis1000

Description

@mmis1000

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

Symptoms: Thousands of iframe created by ublock itself

What happened:

Some poorly written web page repeat

                <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                <ins class="adsbygoogle" style="display:block" width-responsive="true"></ins>
                <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>

everywhere instead of only the <ins> tag.

And ublock inject iframes everytime when you are loading the script

Possibly violating code: https://github.com/gorhill/uBlock/blob/caa8e7d35ba61214a9d13e7d324b2bd2aa73237f/src/web_accessible_resources/googlesyndication_adsbygoogle.js#L38-L46

It inject iframe without checking whether it already exist or not

A specific URL where the issue occurs

https://www.esjzone.cc/detail/1563843171.html

Steps to Reproduce

  1. Make a HTML,
  2. Paste <ins class="adsbygoogle"/><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> about 20 ~ 30 times
  3. Open it with ublock installed

Expected behavior:

Nothing happened, as there is just several tags

Actual behavior:

Ublock inject thousands of iframes into the page, lag the page very seriously.
You won't even able to open the firefox console

Your environment

  • uBlock Origin version: 1.23.0
  • Browser Name and version: Firefox 70~72
  • Operating System and version: Android/Windows/Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedissue has been addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions