• halcyoncmdr@lemmy.world
    link
    fedilink
    English
    arrow-up
    16
    ·
    23 days ago

    Unlike more common formats such as .jpg or .png, .svg uses XML-based text to specify how the image should appear, allowing files to be resized without losing quality due to pixelation. But therein lies the rub: The text in these files can incorporate HTML and JavaScript, and that, in turn, opens the risk of them being abused for a range of attacks, including cross-site scripting, HTML injection, and denial of service.

    Willing to bet that some browsers just do what the SVG says.

    • schnurrito@discuss.tchncs.de
      link
      fedilink
      arrow-up
      17
      ·
      23 days ago

      Yes, you are just quoting the article which I already read, but this fails to answer the question why the same JS does something different depending on whether it is part of an SVG or not. Should it not be possible to put the same JS directly into the HTML?

      • TXL@sopuli.xyz
        link
        fedilink
        arrow-up
        16
        ·
        edit-2
        23 days ago

        The SVG is probably parsed by a different library or different module at least and might have exploitable bugs. Still, the js would likely be fed to the same engine. It might not be impossible that something gets mangled or the context is different.

        But mostly this smells like a fantasy article. No mention of which exact browser, what the mechanism is and, in particular, no sample code. And as a bonus the bs blanket term of “adult sites” which makes this look more like fear propaganda.

        • sunzu2@thebrainbin.org
          link
          fedilink
          arrow-up
          6
          ·
          23 days ago

          I don’t know* jack about shit but I got fud vibe from this headline lol

          Gooners get punished for watching content!