Closed Bug 1764567 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 33622 - Throw exception based on exclusions when creating sanitized cookies

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 33622 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/33622
Details from upstream follow.

Javier Fernández García-Boente <jfernandez@igalia.com> wrote:

Throw exception based on exclusions when creating sanitized cookies

When we get a nullptr cookie from ToCanonicalCookie we assume that
there is an exception to explain the failure. We have a DCHECK to
verify such scenario. However, we only generate assertions if there is
any problem with the cookie url.

The CreateSanitizedCookie function, called to generate the return value
with the canonical cookie, performs some additional checks before
parsing the cookie string. Any error is described in as exclusion in
the CookieInclusionStatus instance. If the status has any exclusion, a
nullptr cookie is returned, but no exception is generated.

The bug 1315053 describes a scenario where we get a nullotr cookie
without an exception, violating the previously mentioned DCHECK. This
change fixes the bug by generating exceptions based on the exclusions
comment if the CreateSanitizedCookie adds any on the status instance.

Bug: 1315053
Change-Id: I0ebbf727f7404391b12446a457247c4468754015
Reviewed-on: https://chromium-review.googlesource.com/3582579
WPT-Export-Revision: fb370e7b5e8059363c01d7e37ae919a8d9e28136

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 9 subtests

Status Summary

Firefox

OK : 2
FAIL: 18

Chrome

OK : 2
PASS: 16
FAIL: 2

Safari

OK : 2
FAIL: 18

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/cookie-store/cookieStore_special_names.https.any.serviceworker.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
cookieStore.set with __Secure- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set of expired __Secure- cookie name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.delete with __Secure- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set of expired __Host- cookie name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.delete with __Host- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- prefix and a domain option: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- prefix a path option: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with malformed name.: FAIL (Chrome: FAIL, Safari: FAIL)
/cookie-store/cookieStore_special_names.https.any.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
cookieStore.set with __Secure- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set of expired __Secure- cookie name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.delete with __Secure- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set of expired __Host- cookie name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.delete with __Host- name on secure origin: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- prefix and a domain option: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with __Host- prefix a path option: FAIL (Chrome: PASS, Safari: FAIL)
cookieStore.set with malformed name.: FAIL (Chrome: FAIL, Safari: FAIL)

Tests Disabled in Gecko Infrastructure

/cookie-store/cookieStore_special_names.https.any.serviceworker.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)
/cookie-store/cookieStore_special_names.https.any.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-linux1804-64-tsan-qr-opt, Gecko-windows10-32-2004-qr-debug, Gecko-windows10-32-2004-qr-opt, Gecko-windows10-64-2004-qr-debug, Gecko-windows10-64-2004-qr-opt] (Chrome: OK, Safari: OK)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/830faa5ad46e
[wpt PR 33622] - Throw exception based on exclusions when creating sanitized cookies, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.