Closed Bug 1718598 Opened 3 years ago Closed 3 years ago

Handle not fully active documents in Permissions API

Categories

(Core :: DOM: Security, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Future
Tracking Status
firefox99 --- fixed

People

(Reporter: marcos, Assigned: marcos)

References

()

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15

Steps to reproduce:

Called .query() permission API by stealing a reference to the permissions API in a not fully active document.

Actual results:

The call to didn't reject.

Expected results:

The .query() method should have returned a rejected promise.

Spec change

Assignee: nobody → marcos

The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Product: Firefox → WebExtensions
Component: Untriaged → DOM: Security
Product: WebExtensions → Core
Target Milestone: --- → Future
Severity: -- → S3
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P3
Whiteboard: [domsecurity-active]

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:marcos, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(marcos)
Flags: needinfo?(jhofmann)

Currently working though spec issues and soliciting feedback from other browser vendors. However, I'm still hoping to land this patch soon.

Flags: needinfo?(marcos)
Flags: needinfo?(jhofmann)
Attachment #9229249 - Attachment description: Handle not fully active documents when querying Permissions API → WIP: Handle not fully active documents when querying Permissions API
Attachment #9229249 - Attachment description: WIP: Handle not fully active documents when querying Permissions API → Handle not fully active documents when querying Permissions API
Pushed by marcos@marcosc.com: https://hg.mozilla.org/integration/autoland/rev/f5bd4427bd30 Handle not fully active documents when querying Permissions API r=johannh

Backed out for causing mochitest failures on test_permissions_api.html.

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception&revision=f5bd4427bd30ac942cca1ea62434935c440a6d18&selectedTaskRun=Horv9guFT9yI1hU4vjx7bw.0

Failure log: https://treeherder.mozilla.org/logviewer?job_id=368572047&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/1c9ba036aeb4698c4c754bf41354af61560ebbd6

[task 2022-02-21T04:44:56.433Z] 04:44:56     INFO -  TEST-PASS | dom/permission/tests/test_permissions_api.html | query should have thrown TypeError for 'undefined'
[task 2022-02-21T04:44:56.433Z] 04:44:56     INFO -  Buffered messages finished
[task 2022-02-21T04:44:56.433Z] 04:44:56  WARNING -  TEST-UNEXPECTED-FAIL | dom/permission/tests/test_permissions_api.html | Unexpected error ReferenceError: aWindow is not defined
[task 2022-02-21T04:44:56.433Z] 04:44:56     INFO -      SimpleTest.ok@SimpleTest/SimpleTest.js:417:16
[task 2022-02-21T04:44:56.433Z] 04:44:56     INFO -      window.onload/<@dom/permission/tests/test_permissions_api.html:289:11
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  TEST-OK | dom/permission/tests/test_permissions_api.html | took 169ms
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  TEST-START | Shutdown
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  Passed:  22
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  Failed:  1
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  Todo:    0
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  Mode:    e10s
[task 2022-02-21T04:44:56.434Z] 04:44:56     INFO -  Slowest: 2280ms - /tests/dom/permission/tests/test_cross_origin_iframe.html
[task 2022-02-21T04:44:56.435Z] 04:44:56     INFO -  SimpleTest FINISHED
[task 2022-02-21T04:44:57.619Z] 04:44:57     INFO -  wait for org.mozilla.geckoview.test_runner complete; top activity=com.android.launcher3
[task 2022-02-21T04:44:57.619Z] 04:44:57     INFO -  runtestsremote.py | Application ran for: 0:00:15.648371
[task 2022-02-21T04:44:57.724Z] 04:44:57     INFO -  Stopping web server
[task 2022-02-21T04:44:57.729Z] 04:44:57     INFO -  Server shut down.
[task 2022-02-21T04:44:57.755Z] 04:44:57     INFO -  Web server killed.
[task 2022-02-21T04:44:57.755Z] 04:44:57     INFO -  Stopping web socket server
[task 2022-02-21T04:44:57.776Z] 04:44:57     INFO -  Stopping ssltunnel
[task 2022-02-21T04:44:57.797Z] 04:44:57     INFO -  leakcheck | refcount logging is off, so leaks can't be detected!
[task 2022-02-21T04:44:57.798Z] 04:44:57     INFO -  runtests.py | Running tests: end.
[task 2022-02-21T04:44:58.090Z] 04:44:58     INFO -  Buffered messages finished
[task 2022-02-21T04:44:58.091Z] 04:44:58     INFO -  Running manifest: dom/security/test/https-first/mochitest.ini
[task 2022-02-21T04:44:58.305Z] 04:44:58     INFO -  runtests.py | Failed to copy /builds/worker/workspace/build/tests/mochitest/hyphenation to profile
[task 2022-02-21T04:44:58.385Z] 04:44:58     INFO -  PID 2924 | pk12util: PKCS12 IMPORT SUCCESSFUL
[task 2022-02-21T04:44:58.467Z] 04:44:58     INFO -  MochitestServer : launching ['/builds/worker/workspace/build/hostutils/host-utils-93.0a1.en-US.linux-x86_64/xpcshell', '-g', '/builds/worker/workspace/build/hostutils/host-utils-93.0a1.en-US.linux-x86_64', '-f', '/builds/worker/workspace/build/hostutils/host-utils-93.0a1.en-US.linux-x86_64/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmpy5ca3hrl.mozrunner'; const _SERVER_PORT = '8854'; const _SERVER_ADDR = '10.0.2.2'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = false;", '-f', '/builds/worker/workspace/build/tests/mochitest/server.js']
[task 2022-02-21T04:44:58.467Z] 04:44:58     INFO -  runtests.py | Server pid: 2933
[task 2022-02-21T04:44:58.471Z] 04:44:58     INFO -  runtests.py | Websocket server pid: 2936
[task 2022-02-21T04:44:58.477Z] 04:44:58     INFO -  runtests.py | SSL tunnel pid: 2940
[task 2022-02-21T04:44:58.741Z] 04:44:58     INFO -  runtests.py | Running with scheme: http
[task 2022-02-21T04:44:58.741Z] 04:44:58     INFO -  runtests.py | Running with e10s: True
[task 2022-02-21T04:44:58.741Z] 04:44:58     INFO -  runtests.py | Running with fission: False
[task 2022-02-21T04:44:58.741Z] 04:44:58     INFO -  runtests.py | Running with cross-origin iframes: False
[task 2022-02-21T04:44:58.742Z] 04:44:58     INFO -  runtests.py | Running with serviceworker_e10s: True
[task 2022-02-21T04:44:58.742Z] 04:44:58     INFO -  runtests.py | Running with socketprocess_e10s: False
[task 2022-02-21T04:44:58.742Z] 04:44:58     INFO -  runtests.py | Running tests: start.
[task 2022-02-21T04:44:58.806Z] 04:44:58     INFO -  adb Granting important runtime permissions to org.mozilla.geckoview.test_runner
[task 2022-02-21T04:45:00.065Z] 04:45:00     INFO -  adb launch_application: am start -W -n org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.TestRunnerActivity -a android.intent.action.MAIN --es env0 MOZ_CRASHREPORTER_NO_REPORT=1 --es env1 MOZ_CRASHREPORTER=1 --es env2 MOZ_CRASHREPORTER_SHUTDOWN=1 --es env3 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es env4 MOZ_IN_AUTOMATION=1 --es env5 R_LOG_LEVEL=6 --es env6 R_LOG_DESTINATION=stderr --es env7 R_LOG_VERBOSE=1 --es env8 XPCOM_DEBUG_BREAK=stack --es env9 MOZ_UPLOAD_DIR=/data/local/tmp/test_root/mozlog --es env10 MOZ_HIDE_RESULTS_TABLE=1 --es arg0 -no-remote --es arg1 -profile --es arg2 /data/local/tmp/test_root/profile/ --ez use_multiprocess True -d 'http://mochi.test:8888/tests?autorun=1&closeWhenDone=1&logFile=%2Fdata%2Flocal%2Ftmp%2Ftest_root%2Flogs%2Fmochitest.log&fileLevel=INFO&consoleLevel=INFO&hideResultsTable=1&manifestFile=tests.json&dumpOutputDirectory=%2Fdata%2Flocal%2Ftmp%2Ftest_root'
[task 2022-02-21T04:45:00.850Z] 04:45:00     INFO -  runtestsremote.py | Application pid: 4443
[task 2022-02-21T04:45:03.068Z] 04:45:03     INFO -  SimpleTest START
[task 2022-02-21T04:45:03.068Z] 04:45:03     INFO -  Dumping test context:
[task 2022-02-21T04:45:03.068Z] 04:45:03     INFO -    fission.autostart=false
[task 2022-02-21T04:45:03.069Z] 04:45:03     INFO -  TEST-START | dom/security/test/https-first/test_bad_cert.html
Flags: needinfo?(marcos)

Thanks Cosmin! Having a look.

Flags: needinfo?(marcos)
Pushed by marcos@marcosc.com: https://hg.mozilla.org/integration/autoland/rev/1b4fb9a56b7f Handle not fully active documents when querying Permissions API r=johannh
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: