skyjake/lagrange Issue #601: Lagrange crashes/locks-up for binary files incorrectly sent as "text/gemini`

Repo Home
Issues

2023-06-14 18:42:26 acidus99

There are files in Geminispace incorrectly served with a `text/gemini` MIME type that are really binaries. Lagrange crashes, locks up, or becomes very slow when loading these URLs, depending on the version/platform (I've seen all 3 happen).

Here is a 14 MB Linux ELF executable, sent with an incorrect `text/gemini` MIME type

gemini://mkl-wlod.srht.site/repo/tree/scripts/.local/bin/gmnigit

As a fix, as mention in #600 you could use the [MIME sniffing standards "mislabeled binary resource" rules](https://mimesniff.spec.whatwg.org/#sniffing-a-mislabeled-binary-resource) to detect when `text/gemini` (and really any `text/*` MIME type) isn't really text, and not attempt to render it.

Comments (0)