Closed Bug 1431539 Opened 6 years ago Closed 6 years ago

:-moz-any breaks the :visited invariants.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(2 files, 1 obsolete file)

The way it's implemented in stylo allows for :-moz-any selectors to the left of a non-link element to affect its style.

Filing as sec-sensitive just in case, though I think it isn't a security issue.
Assignee: nobody → emilio
Attached file Testcase (obsolete) —
Attached file Clearer testcase
(The element should be green, it's red on stylo)
Attachment #8943777 - Attachment is obsolete: true
Attachment #8943779 - Attachment mime type: text/plain → text/html
Looks like it isn't leaking the computed value to content script, so it's probably not a security issue.

If it does leak that, it may be a sec-moderate bug, though.
(In reply to Xidorn Quan [:xidorn] UTC+10 (PTO Jan 19 ~ 29) from comment #4)
> Looks like it isn't leaking the computed value to content script, so it's
> probably not a security issue.
> 
> If it does leak that, it may be a sec-moderate bug, though.

Yeah it does not. Indeed the only way to cause this failure is with nested links, which triggers effectively the construction of a visited and unvisited style down the tree.

This is only the :visited style of an element getting affected by a + combinator, which breaks the model of the "closest relevant link", but I don't think it has any kind of implication, you still match both as visited and unvisited on both so you wouldn't be able to construct a timing attack either.
Attached patch TestsSplinter Review
Attachment #8944362 - Flags: review?(dholbert)
Comment on attachment 8944362 [details] [diff] [review]
Tests

Review of attachment 8944362 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM!
Attachment #8944362 - Flags: review?(dholbert) → review+
I'm pretty sure this is not a security issue at this point, but I can't remove the flag :)
Group: core-security
Well, I tested the test failed without the patch, but not that it passed with it, whoops. Apparently visited-page.html isn't visited on the references, I'll just adapt the test-case a bit.
Flags: needinfo?(emilio)
https://hg.mozilla.org/mozilla-central/rev/2bd97ba1cb81
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: