-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[Lockdown Mode] Disable XSLT parsing for WebKit in Lockdown Mode #47305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
EWS run on previous version of this PR (hash bcc70c6) |
Didn't realise this would kick off adding people as reviewers already! Pre-emptively pushing this one up to check tests (I think I'll need to sort out expected results for other platforms for new LayoutTests), and to get an early review from people. Feedback welcome! |
Transform - <xsl:value-of select="."/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add empty newline at EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you! Fixed!
"XSLTProcessor disabled test" | ||
); | ||
|
||
shouldBeTrue("typeof(XSLTProcessor) === 'undefined'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add empty newline at EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you! Fixed!
bcc70c6
to
c90770b
Compare
EWS run on previous version of this PR (hash c90770b) |
c90770b
to
4978d53
Compare
EWS run on previous version of this PR (hash 4978d53) |
4978d53
to
ff86c20
Compare
EWS run on previous version of this PR (hash ff86c20) |
ff86c20
to
1dfd8d8
Compare
EWS run on previous version of this PR (hash 1dfd8d8) |
https://bugs.webkit.org/show_bug.cgi?id=295107 <rdar://problem/151845594> Reviewed by NOBODY (OOPS!). This patch disables XSLT support when in Lockdown Mode by removing access to the XSLTProcessor constructor to prevent JavaScript usage, and preventing detection of a stylesheet as XSL unless a newly introduced feature flag is enabled. The feature flag is enabled by default and disabled in LDM to prevent any change in current behaviour. Added LayoutTests that ensure XSLTProcessor is inaccessible, and suitably check an XML document with a stylesheet is not processed when in LDM. * LayoutTests/dom/xsl/lockdown-mode/XSLT-disabled.xml: Added. * LayoutTests/dom/xsl/lockdown-mode/XSLT-disabled.xsl: Added. * LayoutTests/js/dom/lockdown-mode/XSLTProcessor-disabled-expected.txt: Added. * LayoutTests/js/dom/lockdown-mode/XSLTProcessor-disabled.html: Added. * LayoutTests/js/dom/lockdown-mode/script-tests/XSLTProcessor-disabled.js: Added. * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/ios/dom/xsl/lockdown-mode/XSLT-disabled-expected.txt: Added. * LayoutTests/platform/mac-wk1/TestExpectations: * LayoutTests/platform/mac/dom/xsl/lockdown-mode/XSLT-disabled-expected.txt: Added. * LayoutTests/platform/win/TestExpectations: * LayoutTests/platform/wpe/TestExpectations: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: * Source/WebCore/dom/Document.cpp: (WebCore::Document::scheduleToApplyXSLTransforms): * Source/WebCore/dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * Source/WebCore/xml/XSLTProcessor.idl:
1dfd8d8
to
5980209
Compare
EWS run on current version of this PR (hash 5980209) |
5980209
5980209
🛠 playstation