From be27a92e35a6b8ddcb9272aa1841e7cfdd9beacf Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Sun, 30 Jun 2024 13:39:09 +0200 Subject: [PATCH] quarto: apply patch removing the usage of polyfill.io in the templates When outputting HTML content with MathJax content a JS library is provided by `cdn.polyfill.io` which is now considered to be a bad actor. https://sansec.io/research/polyfill-supply-chain-attack --- pkgs/development/libraries/quarto/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/libraries/quarto/default.nix b/pkgs/development/libraries/quarto/default.nix index 78dc32fbbf55..346fb094473d 100644 --- a/pkgs/development/libraries/quarto/default.nix +++ b/pkgs/development/libraries/quarto/default.nix @@ -5,6 +5,7 @@ , esbuild , deno , fetchurl +, fetchpatch , dart-sass , rWrapper , rPackages @@ -29,6 +30,16 @@ stdenv.mkDerivation (final: { makeWrapper ]; + patches = [ + (fetchpatch { + name = "drop-usage-known-bad-actor-cdn.patch"; + url = "https://github.com/quarto-dev/quarto-cli/commit/9f02884fec462e16b82bdf0acc632246b2f40201.patch"; + relative = "src/resources"; + extraPrefix = "share/"; + hash = "sha256-RUIaQCqi3fWn1UIxcMi6/6vh4ANuL44uOnC/bnsHT/k="; + }) + ]; + postPatch = '' # Compat for Deno >=1.26 substituteInPlace bin/quarto.js \