[css-random] Ensure random() values are the same across static cloned documents (print preview)
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: sajidanwar, Assigned: sajidanwar)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 external file, 1 obsolete file)
|
2.88 KB,
text/html
|
Details |
The random() function has a document-level identifier that influences every generated value; and additionally, any functions with an element-scoped key has an element-level identifier that influences those generated values. This is somewhat tricky with Gecko's static cloned documents (Bug 487667) which are used for print previews. Since the document and all elements within are cloned, a simple implementation that uses document/element pointer addresses in the random value generation will generate all new values in a print preview document.
Secondary concern is that since authors have full control of the cache key, they could generate an arbitrary number of hash(--foo + <document-pointer-address>) -> seed -> PRNG value values and possibly reverse engineer the document pointer address. (Maybe, not really any experience with security but this seems plausible and probably shouldn't be allowed.)
| Assignee | ||
Comment 1•1 month ago
|
||
Test case that generates random widths for bars, and then places tick marks at the computed widths. When the user enters print preview, the bars and tick marks should match. If the bars are different widths and don't match the tick marks, then it means that the random widths changed.
Chrome and Safari retain the random values in print preview. Firefox does not.
Comment 2•1 month ago
|
||
Well they retain the whole document, which has its own issues...
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 4•1 month ago
|
||
Updated•1 month ago
|
Comment 6•15 days ago
|
||
| bugherder | ||
Updated•8 days ago
|
Description
•