• pdr@chromium.org's avatar
    Enforce SVG image security rules · ee281f7c
    pdr@chromium.org authored
    SVG images have unique security rules that prevent them from loading
    any external resources. This patch enforces these rules in
    ResourceFetcher::canRequest for all non-data-uri resources. This locks
    down our SVG resource handling and fixes two security bugs.
    
    In the case of SVG images that reference other images, we had a bug
    where a cached subresource would be used directly from the cache.
    This has been fixed because the canRequest check occurs before we use
    cached resources.
    
    In the case of SVG images that use CSS imports, we had a bug where
    imports were blindly requested. This has been fixed by stopping all
    non-data-uri requests in SVG images.
    
    With this patch we now match Gecko's behavior on both testcases.
    
    BUG=380885, 382296
    
    Review URL: https://codereview.chromium.org/320763002
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@176084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    ee281f7c
svg-image-with-cached-remote-image-expected.html 859 Bytes