forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect nosniff on XML external entity resources
Bug: 352038139 Change-Id: I3f5d3007bc79fcb40d0deef8177d7e9335cfb9de Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5828467 Reviewed-by: Mike West <[email protected]> Commit-Queue: Daniel Cheng <[email protected]> Reviewed-by: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1351056}
- Loading branch information
1 parent
d11d181
commit 5c337a0
Showing
7 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...y/blink/web_tests/http/tests/security/contentTypeOptions/xml-external-entity-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CONSOLE ERROR: Refused to load XML external entity from 'http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=application/xml' because its MIME type ('application/xml') is incorrect, and strict MIME type checking is enabled. | ||
CONSOLE ERROR: Refused to load XML external entity from 'http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/xml' because its MIME type ('text/xml') is incorrect, and strict MIME type checking is enabled. | ||
CONSOLE ERROR: Refused to load XML external entity from 'http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/html' because its MIME type ('text/html') is incorrect, and strict MIME type checking is enabled. | ||
CONSOLE ERROR: Refused to load XML external entity from 'http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/javascript' because its MIME type ('text/javascript') is incorrect, and strict MIME type checking is enabled. | ||
CONSOLE MESSAGE: Executed script with MIME type: 'application/xml-external-parsed-entity'. | ||
CONSOLE MESSAGE: Executed script with MIME type: 'text/xml-external-parsed-entity'. | ||
Test nosniff when loading XML external entities.On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".PASS successfullyParsed is true | ||
TEST COMPLETE | ||
|
29 changes: 29 additions & 0 deletions
29
third_party/blink/web_tests/http/tests/security/contentTypeOptions/xml-external-entity.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" | ||
[ | ||
<!ENTITY entity_application_xml_external_parsed_entity SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=application/xml-external-parsed-entity"> | ||
<!ENTITY entity_text_xml_external_parsed_entity SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/xml-external-parsed-entity"> | ||
<!ENTITY entity_application_xml SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=application/xml"> | ||
<!ENTITY entity_text_xml SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/xml"> | ||
<!ENTITY entity_text_html SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/html"> | ||
<!ENTITY entity_text_javascript SYSTEM "http://127.0.0.1:8000/security/contentTypeOptions/resources/script-with-header.pl?mime=text/javascript"> | ||
]> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<script type="text/javascript"><![CDATA[ | ||
window.jsTestIsAsync = true; | ||
description("Test nosniff when loading XML external entities."); | ||
window.onload = () => { | ||
finishJSTest(); | ||
} | ||
]]></script> | ||
<script type="text/javascript">&entity_application_xml_external_parsed_entity;</script> | ||
<script type="text/javascript">&entity_text_xml_external_parsed_entity;</script> | ||
<script type="text/javascript">&entity_application_xml;</script> | ||
<script type="text/javascript">&entity_text_xml;</script> | ||
<script type="text/javascript">&entity_text_html;</script> | ||
<script type="text/javascript">&entity_text_javascript;</script> | ||
</head> | ||
</html> |