• lambalicious
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    2
    ·
    5 months ago

    Only an idiot parses an image file as executable code.

      • lambalicious
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        1
        ·
        5 months ago

        It works both ways, which ultimately is the issue.

        • CeeBee_Eh@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          5 months ago

          A well created malicious exploit will look like an image (or any other file) to a user, but can execute arbitrary code.

          That’s why I thought maybe you were just making a joke.

          • lambalicious
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            5 months ago

            Sure but that requires the given parser (the web browser, the image lib, etc) to arbitrarily run code in the first place. Which… well, why? It’s an image, not a program. Treat it as an image. Hence “only an idiot” writes an image parser to actually execute an image (same with eg.: only an idiot would write an MP3 parser that arbitrarily executes an MP3).

            Even if an SVG had JS in it, as an image-proccessing lib the correct method would be not to try to run the JS in your SVG by yourself but rather just hand it down to whoever is processibg JS at the moment (which would be, well, the browser context and its sandbox).