From 601501a4b09c99cdd7f8742d6c2cd2b8f1a1eb91 Mon Sep 17 00:00:00 2001 From: 4gray Date: Fri, 17 Jul 2026 21:47:25 +0200 Subject: [PATCH] fix(packaging): reject arbitrary Snap YAML aliases --- tools/packaging/verify-linux-frame-copy-runtime.mjs | 2 +- tools/packaging/verify-linux-frame-copy-runtime.test.mjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/packaging/verify-linux-frame-copy-runtime.mjs b/tools/packaging/verify-linux-frame-copy-runtime.mjs index afb5bce81..014e3d5f3 100644 --- a/tools/packaging/verify-linux-frame-copy-runtime.mjs +++ b/tools/packaging/verify-linux-frame-copy-runtime.mjs @@ -520,7 +520,7 @@ function containsUnsupportedYamlSemantics(lines) { blockScalarParentIndent = null; const syntax = yamlSyntaxOutsideQuotedScalars(line); if ( - /(?:^|[\s:[\]{},])(?:[&*][A-Za-z0-9_-]+|![^\s,[\]{}]+)(?=$|[\s,\]}])/.test( + /(?:^|[\s:[\]{},])(?:[&*][^\s,[\]{}]+|![^\s,[\]{}]+)(?=$|[\s,\]}])/.test( syntax ) || /(?:^|\s)<<\s*:/.test(syntax) diff --git a/tools/packaging/verify-linux-frame-copy-runtime.test.mjs b/tools/packaging/verify-linux-frame-copy-runtime.test.mjs index 49d9fc7a2..6ee819b60 100644 --- a/tools/packaging/verify-linux-frame-copy-runtime.test.mjs +++ b/tools/packaging/verify-linux-frame-copy-runtime.test.mjs @@ -665,10 +665,10 @@ test('requires a private top-level shared-memory plug used by the Snap app', () [ (contents) => [ - 'shared-interface: &sharedInterface shared-memory', + 'shared-interface: &shared.interface shared-memory', contents.replace( '\nplugs:\n', - '\nplugs:\n alias-plug:\n interface: *sharedInterface\n' + '\nplugs:\n alias-plug:\n interface: *shared.interface\n' ), ].join('\n'), /anchors, aliases, merge keys, or custom tags/i,