Skip to content

Sign .js files with 3PartyScriptsSHA2 for VS signing compliance#1666

Closed
jesuszarate wants to merge 1 commit intodotnet:mainfrom
jesuszarate:dev/jezarat/sign-js-files
Closed

Sign .js files with 3PartyScriptsSHA2 for VS signing compliance#1666
jesuszarate wants to merge 1 commit intodotnet:mainfrom
jesuszarate:dev/jezarat/sign-js-files

Conversation

@jesuszarate
Copy link
Copy Markdown

Summary

Sign .js files in the Emscripten SDK workload packs with 3PartyScriptsSHA2 instead of skipping them (None).

Problem

VS signing scans flag ~14,468 unsigned files across all Emscripten SDK workload packs (.NET 6–10). The .js files inside these packs are 3rd-party OSS Emscripten toolchain files shipped inside VS workload pack MSIs. They are currently not signed because eng/Signing.props explicitly sets CertificateName="None" for .js files with the comment "We don't need to code sign .js files because they are not used in Windows Script Host."

While that rationale is correct for script execution, VS signing compliance requires all files in setup packages to be signed regardless of their runtime usage.

Fix

Changed FileExtensionSignInfo for .js from CertificateName="None" to CertificateName="3PartyScriptsSHA2" (cert 135020022), which is the correct certificate for 3rd-party OSS script files per the Signing Cert Guidance wiki.

Impact

After this change flows through the staging pipeline and into VS, the ~14,468 previously-unsigned .js files across all emsdk workload packs will be properly signed.

@akoeplinger
Copy link
Copy Markdown
Member

as far as I know we tried this in the past but signing the files broke something due to how the signing comment gets embedded in the .js file

VS signing needs to be updated to handle this case, the rules are clear that you only need .js signing for Windows Script Host

Copy link
Copy Markdown
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

The .js files in the Emscripten SDK are customer-modifiable toolchain files
that cannot be directly Authenticode-signed (modifying a signed file breaks
the signature). Instead, generate a .cat catalog file covering all .js files,
which is signed with MicrosoftDotNet500 via the existing FileExtensionSignInfo
entry for .cat files.

The GenerateCatalogFiles target runs after ReallyBuild on Windows only
(makecat.exe is a Windows SDK tool), generates a CDF listing all .js files,
produces emscripten-js.cat, and places it in the SDK package directory so it
ships alongside the files it covers.

This fixes ~14,468 unsigned .js files flagged by VS signing compliance scans.
@jesuszarate jesuszarate force-pushed the dev/jezarat/sign-js-files branch from 5e90189 to 5ed1cb7 Compare March 27, 2026 20:27
@akoeplinger
Copy link
Copy Markdown
Member

Superseded by #1671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants