We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[vulnerability] Scripts in SVG are not hooked
<object data="URL">
<object data="{URL}">
<svg><script>location = "{URL}";</script></svg>
bootstrap.js
hook.parameters.emptySvg = `<?xml version="1.0"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1px" height="1px"><script>location = "$location$";</script></svg>`; hook.parameters.bootstrapSvgScripts = ` <script xlink:href="${new URL('../../thin-hook/hook.min.js?no-hook=true&hook-name=__hook__&context-generator-name=method&discard-hook-errors=false&fallback-page=index-fb.html&hook-property=true&hook-global=true&hook-prefix=_pp_&compact=true&no-hook-authorization=', baseURI).href.replace(/\&/g, '&') + noHookAuthorization}"></script> <script xlink:href="${new URL('no-hook-authorization.js?no-hook=true', baseURI).href}"></script> <script xlink:href="${new URL('context-generator.js?no-hook=true', baseURI).href}"></script> <script xlink:href="${new URL('bootstrap.js?no-hook=true', baseURI).href}"></script> <script xlink:href="${new URL('hook-callback.js?no-hook=true', baseURI).href}"></script> <script xlink:href="${new URL('hook-native-api.js?no-hook=true', baseURI).href}"></script>`;
<
data:
blob:
<img>
<object id="objectStaticData" data="inline-script.svg"></object> <iframe id="iframeStaticSrcSVG" src="inline-script.svg"></iframe>
<?xml version="1.0"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" width="200px" height="200px"> <script><![CDATA[ navigator.serviceWorker; ]]></script> <rect id="rect" x="0px" y="0px" width="200px" height="200px" stroke="blue" fill="white"/> </svg>
The text was updated successfully, but these errors were encountered:
74ee806
0.0.241 with vulnerability Fix #250 Hook scripts in SVG and block dat…
06c759b
…a:/blob: URLs for SVG
[vulnerability] Fix #250. Block iframe src data:/blob: properly
ebef484
0.0.242 with vulnerability Fix #250 Hook scripts in SVG and block dat…
e4f7d38
…a:/blob: for SVG
embed
<![CDATA[
]]>
Sorry, something went wrong.
c859390
0.0.243 with vulnerability Fix #250 Hook scripts in SVG
b3462cf
No branches or pull requests
[vulnerability] Scripts in SVG are not hooked
Root Causes
<object data="URL">
requests bypass Service WorkerFix
<object data="{URL}">
as data URL for<svg><script>location = "{URL}";</script></svg>
to avoid bypassing Service Workerbootstrap.js
)Notes
<
cannot be used in raw scripts in SVGdata:
,blob:
URLs are blocked<img>
tags are NOT executed by default.Reproducible Code Examples
The text was updated successfully, but these errors were encountered: