Closed Bug 1828126 Opened 2 years ago Closed 2 years ago

Add a mechanism to fix cookies with invalid future createdAt timestamp

Categories

(Core :: Networking: Cookies, task, P2)

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: emz, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(3 files)

For Bug 1827669 we've seen cookies being created which have a createdAt timestamp that is very far in the future. The exact cause and potential regressor of this is currently unknown.
We should add a check in the persistent cookie storage that either deletes or clamps these invalid cookies timestamps to the current date.
Whenever we find cookies with a createdAt timestamp far in the future we can collect telemetry. This is to determine how many users are affected.

See Also: → 1827669

Some more notes from today's meeting:

On cookie import on startup we should perform the following checks:

createdTime: if > PR_NOW + threshold => set to PR_NOW
lastAccessed: if > createdTime(new) => set to createdTime(new)
Expiry: Don’t touch, if it’s expired it will be cleaned up already, if its in the future (even far) that’s allowed

If we performed any of the above actions, send telemetry. Telemetry should ideally include metadata about the state of the cookie db.

Do we mess up the monotonic time increase behaviour?
This is used for comparing cookies
Before landing a patch we need to find out why or if we need the monotonic behavior. See bug 1828131.

Depends on: 1828131
Severity: -- → S2
Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee: nobody → valentin.gosu
Status: NEW → ASSIGNED
Attachment #9330028 - Flags: data-review?(chutten)

Comment on attachment 9330028 [details]
data-review for bug 1828126.md

PRELIMINARY NOTES:
This is a Glean collection so you might find ./mach data-review useful to generate your data collection review request for you.

DATA COLLECTION REVIEW RESPONSE:

Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?

Yes.

Is there a control mechanism that allows the user to turn the data collection on and off?

Yes. This collection can be controlled through Firefox's Preferences.

If the request is for permanent data collection, is there someone who will monitor the data over time?

Yes, :valentin is responsible.

Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Category 1, Technical.

Is the data collection request for default-on or default-off?

Default on for all channels.

Does the instrumentation include the addition of any new identifiers?

No.

Is the data collection covered by the existing Firefox privacy notice?

Yes.

Does the data collection use a third-party collection tool?

No.


Result: datareview+

Attachment #9330028 - Flags: data-review?(chutten) → data-review+

(In reply to Chris H-C :chutten from comment #5)

This is a Glean collection so you might find ./mach data-review useful to generate your data collection review request for you.

Thanks, I'll use that in the future 🙂

Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/bf9de9179b04 Add a mechanism to fix cookies with invalid future createdAt timestamp r=pbz,edgul,cookie-reviewers https://hg.mozilla.org/integration/autoland/rev/66859868cbe0 Test for cookie timestamp fixup r=pbz,cookie-reviewers

Backed out for causing xpcshell failures in test_timestamp_fixup.js.

Flags: needinfo?(valentin.gosu)

Ah, dangity dang. This is bug 1752139

To unblock, just skip-if android on this test and reference bug 1752139. Sorry about that.

See Also: → 1752139

(In reply to Chris H-C :chutten from comment #9)

Ah, dangity dang. This is bug 1752139

To unblock, just skip-if android on this test and reference bug 1752139. Sorry about that.

skipping the entire test on android might be too risky. I suggest we only skip the telemetry parts of this test instead. But I'll leave that to Valentin do decide.

Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/4460342f6491 Add a mechanism to fix cookies with invalid future createdAt timestamp r=pbz,edgul,cookie-reviewers https://hg.mozilla.org/integration/autoland/rev/3ae7b3be5bb7 Test for cookie timestamp fixup r=pbz,cookie-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Flags: needinfo?(valentin.gosu)

Might be worth using the reminder feature of autonag?

Whiteboard: [necko-triaged] → [necko-triaged][reminder-test 2023-08-15]

a month ago, valentin placed a reminder on the bug using the whiteboard tag [reminder-test 2023-08-15] .

valentin, please refer to the original comment to better understand the reason for the reminder.

Flags: needinfo?(valentin.gosu)
Whiteboard: [necko-triaged][reminder-test 2023-08-15] → [necko-triaged]
Blocks: 1828131
No longer depends on: 1828131

(In reply to Valentin Gosu [:valentin] (he/him) from comment #14)

https://glam.telemetry.mozilla.org/fog/probe/networking_cookie_timestamp_fixed_count/explore
https://glam.telemetry.mozilla.org/fog/probe/networking_cookie_creation_fixup_diff/explore
https://glam.telemetry.mozilla.org/fog/probe/networking_cookie_access_fixup_diff/explore

I think we should check back in a few releases to see if the number of clients affected by this is high or low.

I've addressed this in bug 1828131 comment 4. About 0.5-1.5 million clients per release are still affected.

Flags: needinfo?(valentin.gosu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: