Skip to content

electron-updater@7.0.0-alpha.14

Pre-release
Pre-release

Choose a tag to compare

@electron-builder-release-bot electron-builder-release-bot released this 21 Nov 01:21
Immutable release. Only release title and notes can be modified.
1b1696b

Major Changes

  • Fix(updater)!: reject an update manifest whose YAML aliases expand to more than 100000 values, keys and string characters (or more than the length of a larger file) with ERR_UPDATER_INVALID_UPDATE_INFO, so comparing or serializing the update info cannot freeze the app. electron-updater 6 accepted such a manifest; manifests electron-builder writes contain no aliases and are unaffected, but one that another tool writes or rewrites with aliases (e.g. js-yaml dump without noRefs) stops updating installs: write it without aliases or with the shared values repeated inline. The error links the migration guide. Private GitHub repositories parse their manifest the same way as the other providers, and the Bitbucket and Keygen providers report a manifest they cannot parse with ERR_UPDATER_INVALID_UPDATE_INFO (was ERR_UPDATER_LATEST_VERSION_NOT_FOUND). The ERR_UPDATER_INVALID_UPDATE_INFO messages name the channel file URL without its query string, so a token in the feed URL is not logged. #10514 a61262c

    See https://www.electron.build/docs/migration/v27-runtime-changes#update-manifest-yaml-aliases-are-limited

  • Fix(updater)!: a deb/rpm/pacman update installed with gksudo, kdesudo or beesu needs an installer path of ASCII letters, digits and ._/+,:=@%- (and a space with kdesudo), and non-ASCII characters other than control, format and separator characters, the characters their single command string carries safely; any other path fails with ERR_UPDATER_UNSAFE_INSTALLER_PATH before the helper runs. pkexec and sudo take any path. #10524 d996835

  • Feat(updater)!: the app chooses the request headers sent to another origin with the required autoUpdater.crossOriginHeaders property: (headerNames: string[], hop: { from: URL; to: URL }) => string[] (the CrossOriginHeadersCallback and CrossOriginHop types), null by default. electron-updater calls it for each request and redirect to another origin than the update feed (Provider.feedBaseUrl; private GitHub's feed is the GitHub API): a redirect, a download or channel file on another origin, a blockmap or differential range request and their redirects, a private GitHub release asset or GitLab release link on another origin, and a provider's own request there. It gets the lowercase names of the request headers about to be sent, never their values, and returns the names of the ones to send (case-insensitive); the feed's origin gets every header without it. A header it leaves out stays on the original origin: Authorization from addAuthHeader, a custom header from requestHeaders, a provider's token (private GitHub, GitLab), a provider's other request headers and x-user-staging-id. The headers electron-updater builds for each request itself are sent whatever it returns: its default User-Agent, Cache-Control, the Accept it or the provider sets, and Range; an app's own User-Agent from requestHeaders goes to another origin only when it keeps user-agent. autoUpdater.crossOriginHeaders = () => [] sends none of the app's headers to another origin. Without a function, checkForUpdates(), checkForUpdatesAndNotify() and downloadUpdate() emit error and reject with ERR_UPDATER_CROSS_ORIGIN_HEADERS_NOT_CONFIGURED, whose message names the property and links the migration guide, and so does each request to another origin, such as one of the install at launch of an update marked for the next launch: set it before the app is ready. An unpackaged app without forceDevUpdateConfig, which skips the check, gets the same error from checkForUpdates() and checkForUpdatesAndNotify(), so a missing callback shows up in development. A throw, or a result that is not an array of strings, fails that request, unsent, with ERR_UPDATER_INVALID_CROSS_ORIGIN_HEADERS. builder-util-runtime: HttpExecutor takes a CrossOriginHeaderPolicy ((headers, hop) => headers) for its redirects as its constructor argument, by default electron-builder's, which leaves out the credential-bearing headers (see addSensitiveRedirectHeader); HttpExecutor.crossOriginHeaders(headers, ownHeaders, hop, policy) applies one, and ApiRequestOptions.ownHeaders and DownloadOptions.ownHeaders name the headers a request builds itself, which a hop to another origin sends whatever the policy keeps. electron-updater's ProviderRuntimeOptions has a required crossOriginHeaderPolicy, set by electron-updater, so code that constructs a built-in provider passes on the runtime options it was given. The first time a request to an origin goes without some of the app's or a provider's headers, electron-updater logs a warning, once per origin, naming those headers and both origins (never a value), with a link to the migration guide. A Host header is never sent to another origin. A provider constructed with runtime options without a crossOriginHeaderPolicy function throws ERR_UPDATER_CROSS_ORIGIN_HEADER_POLICY_MISSING. See https://www.electron.build/docs/migration/v27-runtime-changes#cross-origin-headers #10563 d699bdf — electron-updater, builder-util-runtime

  • Feat!: electron-updater sends every update-feed request header and the feed query only to downloads on the feed's origin. With the generic, s3, spaces, r2, keygen, bitbucket, github and gitlab providers, a download on another origin than the feed (scheme, host or port) — an absolute files[].url or packages.<arch>.path in latest*.yml, a GitLab release asset link, and the blockmaps and differential range requests derived from them — is requested with only the headers from requestHeaders / addAuthHeader that the app's autoUpdater.crossOriginHeaders keeps (see https://www.electron.build/docs/migration/v27-runtime-changes#cross-origin-headers) and without the feed URL's query string. Such a URL keeps its own query string, so pre-signed URLs work. With every provider, including custom ones, a URL that electron-updater resolves against the feed URL (such as a files[].url or a blockmap) gets the feed query only on the feed's origin; as on redirects, an http → https upgrade of the feed host on the default ports keeps the headers and the query. Downloads on the feed origin get every request header and the feed query, and the old blockmap from an app-set previousBlockmapBaseUrlOverride gets every request header on that origin. If your latest*.yml points downloads at another origin that needs these headers, serve the files from the feed origin, use pre-signed URLs, or keep the headers for that origin in autoUpdater.crossOriginHeaders. The NSIS web-package differential download uses the same per-download headers as other downloads. Every provider returns its feed URL from Provider.feedBaseUrl: the built-in ones return theirs (private GitHub returns the GitHub API, whose asset URLs need its token), and a custom provider whose feedBaseUrl is not a URL, null included, fails the update check with ERR_UPDATER_FEED_BASE_URL_NOT_DECLARED before it gets any request header (see https://www.electron.build/docs/migration/v27-developer-changes#custom-provider-feed-base-url). The first download that does not get the feed query logs a warning once per updater, naming the query parameters and the origins (never their values), with a link to the migration guide. New APIs: Provider.feedBaseUrl (required), HttpExecutor.crossOriginHeaders and HttpExecutor.isCrossOrigin. #10270 ec9135d — electron-updater, builder-util-runtime · updated in #10563

  • Feat(updater)!: reject plain http update requests and https-to-http redirects (except to a loopback host) with ERR_UPDATER_INSECURE_FEED unless the app sets AppUpdater.allowInsecureFeed, which is meant for development (autoUpdater.allowInsecureFeed = !app.isPackaged): a packaged app with it set logs a warning once, the first time it loads update info (an update check, or the validation of an update pending install at launch); the build warns when the feed written to app-update.yml (a generic or custom publish url, a github protocol: "http" or an s3 endpoint without accelerate) uses plain http to a host that is not loopback. With allowInsecureFeed, a server's authentication challenge on a request that is neither https nor to a loopback host is cancelled without emitting login. A redirect to a loopback host (http or https) from a URL that is not on one fails with ERR_UPDATER_LOOPBACK_REDIRECT, whatever allowInsecureFeed is; ApiRequestOptions.redirectedFromNonLoopback carries that through a redirect chain. https://www.electron.build/docs/migration/v27-runtime-changes#update-requests-require-https #10566 e955338 — electron-updater, builder-util-runtime

  • Feat(nsis)!: an nsis-web installer started as an update (--updated) without --package-file aborts (exit code 2), electron-updater rejects a web-installer update without a package for the app's arch or ia32 before downloading it (ERR_UPDATER_NO_WEB_PACKAGE_FOR_ARCH), and the NSIS updater installs an update whose manifest signature is not verified only when the ProductVersion of its installer is the update version (ERR_UPDATER_INSTALLER_VERSION_MISMATCH) #10601 03cf406

Minor Changes

  • Feat(updater): channel files (latest*.yml) are limited to 10 MiB, since they are parsed before anything verifies them: a larger one fails the update check with ERR_UPDATER_RESPONSE_TOO_LARGE. maxUpdateInfoSize in the publish configuration (written into app-update.yml) or autoUpdater.maxUpdateInfoSize sets the limit in bytes, or 0 for none. #10508 c79e07c — electron-updater, builder-util-runtime
  • Feat(updater): the login event gets the URL of the update request that got the authentication challenge as its third argument, (authInfo, callback, url), so a handler answers a server's challenge only for the origin its credentials are meant for (new URL(url).origin) and a proxy's by authInfo.isProxy. A login handler cancels a challenge by calling callback() without credentials, and without a login listener the updater cancels it and logs a warning once with the challenger's host and port; a throwing listener cancels it too. A server's challenge from another origin than the feed logs a warning once when no login handler takes the url argument. See https://www.electron.build/docs/features/auto-update#event-login and https://www.electron.build/docs/migration/v27-runtime-changes#update-credentials-stay-on-the-feeds-origin #10565 1b4b37c
  • Feat(runtime): HttpExecutor.addRedirectHandlers is public, so that requests made outside the executor (electron-updater's differential downloads) follow redirects with the same rules: a redirect to another origin sends the headers the executor's cross-origin header policy keeps, plus the request's own (ownHeaders), and the executor's redirect limit applies #10419 2d97c85 — builder-util-runtime · updated in #10568
  • Feat(updater): optional files[].blockMapUrl in latest*.yml names a file's blockmap URL (e.g. a separately pre-signed one) instead of ${url}.blockmap with the file URL's query string. A relative value resolves like url (against the feed URL); an absolute URL is used as-is, with its own host and query string. On the feed's origin it gets every request header and the feed query; on another origin it gets no feed query and only the request headers the app's autoUpdater.crossOriginHeaders keeps. With a blockMapUrl, the old blockmap is not derived from the new file's URL: it comes from the local cache, else from previousBlockmapBaseUrlOverride, else that update is downloaded in full (which caches the new blockmap). The manifest signature covers blockMapUrl when present, as an extra field on the file record, so manifests without it canonicalize and verify exactly as before; an electron-updater without this change refuses a signed manifest that has one. electron-builder does not write it. The private GitHub and GitLab providers, which resolve files from the release assets, ignore it. #10270 ec9135d — electron-updater, builder-util-runtime · updated in #10568
  • Feat(updater): add NsisUpdater.publisherName (autoUpdater.publisherName, default null), the subject(s) of the certificate that signs your updates, to verify an NSIS update against when the update config has no publisherName. The publisherName of app-update.yml wins over it, and it wins over verifyUpdateCodeSignature: false. A packaged app whose update config file is missing when an update is verified rejects the update without it (ERR_UPDATER_NO_PUBLISHER_NAME), and a custom verifier is never called without a publisherName #10600 a69c30a

Patch Changes

  • Remove the lodash.isequal dependency: the in-memory check for an already downloaded update compares the update info with util.isDeepStrictEqual. #10484 ea85d41

  • Feat: blockMapV2ToV3Keys (internal) converts a parsed v2 block map to the block keys toBlockMap gives a v3 map, so maps of the two formats can be compared block by block; it rejects a map whose checksums are not base64 blake2b-18 digests or whose blocks a v3 record cannot hold #10497 39db76f — builder-util-runtime

  • Feat: the first update after an app switches its .blockmap format (e.g. from "v2" to "v3") is differential instead of a full download. Both formats cut the same blocks with the same blake2b digest, and a v2 map stores the digest whose first 8 bytes are the v3 block hash, so the cached map of one format is compared with the new map of the other by those bytes, without reading or re-hashing the installed file. A v2 map whose checksums are not those digests still falls back to a full download (ERR_UPDATER_BLOCKMAP_FORMAT_CHANGED, logged once at info) #10497 39db76f

  • Fix(runtime): a download follows a Location header only on a 3xx response, and a redirect it cannot follow (another protocol than http(s), or an invalid URL) now fails the download instead of throwing an uncaught exception and stalling until the request times out. On Node, a request's socket timeout ends with the request, so the keep-alive agent's idle timeout on a redirect's released socket does not fail the download of the redirect target with "Request timed out" #10505 c5b5895 — electron-updater, builder-util-runtime

  • Fix(updater): reject a differential download plan with empty, negative or fractional ranges (from a malformed blockmap) before any request, so it falls back to a full download; a copy of a range the old file cannot be read with fails the download with an error #10512 2cddd42

  • Fix(updater): parse the boundary of a multipart/byteranges Content-Type in linear time and accept only a boundary of 1 to 70 characters (RFC 2046), so a long malformed header in a multi-range response is rejected at once during a differential download and quoted only in part in the error #10513 2cdcc45

  • Fix(updater): install an update deferred with quitAndInstall({ waitUntilNextLaunch: true }) at the next launch with any autoInstallEvent but "manual", once the app's own ready handlers have run #10525 2e10208

  • Fix(updater): keep autoUpdater working when electron-updater is bundled into the main process (Vite/Rollup, esbuild) #10531 f8d6d61

  • Fix(updater): bound how far a blockmap may inflate (to a limit derived from the update's size) and validate an embedded blockmap's size before reading it, so an oversized blockmap falls back to a full download before it can exhaust memory #10511 fcf5e61

  • Fix(updater): check a v3 blockmap's header (the size limit derived from the update's size, exact length, the update's file size) and tables before decoding or range-fetching its records, and keep decoded records compact, so a map declaring millions of blocks falls back to a full download before it can exhaust memory #10515 bfd6405 — electron-updater, builder-util-runtime

  • Fix(updater): check that a v3 blockmap's super-group and group counts sum to its header before planning Range requests from them, and refuse a Range request larger than the blockmap size limit, so every range the updater requests and buffers lies within that limit #10517 13d953d — electron-updater, builder-util-runtime

  • Fix(updater): name the downloaded NSIS web installer package after the URL path only, so a feed or package URL with a query (an auth token, a pre-signed URL, Keygen's ?product=) no longer yields an invalid Windows file name that made every web-installer update download fail, and install a package reused from the cache under the name it was saved with #10526 96e0644

  • Fix(runtime): cancelling a download now aborts its HTTP request, so a cancelled update download (or blockmap download) no longer keeps transferring and writing to the download file in the background #10506 be288a8 — electron-updater, builder-util-runtime

  • Fix(updater): a redacted log or error message holds at most 16 fingerprints of sensitive values (such as those in the JSON body or the headers of an error response); further sensitive values are logged as <redacted>. The publish configuration keys of the build fingerprint every sensitive value, so configurations that differ in any of them get their own publisher and update info file #10509 36f0536 — electron-updater, builder-util-runtime

  • Fix(runtime): on Node, a download that fails with a status of 400 or more drains the response, so its socket is released and the request's socket timeout does not call back the failed download a second time with "Request timed out" #10510 2a5a06f — electron-updater, builder-util-runtime

  • Fix(updater): a channel file request (latest*.yml) to another origin than the update feed, such as a GitLab release link to another host or a channel that is a URL, sends only the request headers (from requestHeaders / addAuthHeader) that the app's autoUpdater.crossOriginHeaders keeps, the same rule as for downloads, so credential headers such as Authorization stay on the feed's origin unless it keeps them; so does a provider's own httpRequest to another origin than its feedBaseUrl, the headers of its headers argument included, apart from its Accept #10520 3add3dc

  • Fix(updater): when a signed update manifest with a stagingPercentage fails verification, say that stagingPercentage is covered by the signature and link the staged-rollout docs, which now explain how to sign latest*.yml again after changing it #10530 e56fd9a

  • Fix(updater): electron-updater requires js-yaml ^4.3.2 (GHSA-2883-xcg3-v3hh, GHSA-5p4m-2wfm-xmqj, GHSA-52cp-r559-cp3m), so a channel file (latest*.yml) full of YAML merge keys, which is parsed before its signature is checked, is rejected quickly with ERR_UPDATER_INVALID_UPDATE_INFO #10522 07d5b19

  • Fix(updater): count YAML aliases against the update manifest's alias budget while the manifest is loaded, so a latest*.yml whose non-scalar mapping keys (? [*a, *a, ...]) expand into very long strings is rejected with ERR_UPDATER_INVALID_UPDATE_INFO before the strings are built. An alias counts at least as many characters as it adds to such a key, so an aliased timestamp counts as about 60 characters and an aliased number by the length of its text #10536 896ba56

  • Fix: a download that fails with a status of 400 or above rejects with an HttpError carrying statusCode and code: "HTTP_ERROR_<status>", and its message leaves out the URL's query string and hash so signed links don't reach logs #10549 141bb9b — builder-util-runtime

  • Fix: HttpExecutor.crossOriginHeaders copies the headers with deepAssign, which ignores __proto__, constructor and prototype keys #10270 ec9135d — builder-util-runtime · updated in #10563

  • Fix(runtime): a cross-origin redirect drops the request auth option (Basic credentials), whatever headers it keeps, so it goes only to the original origin; with DEBUG=electron-builder a debug line names both origins. https://www.electron.build/docs/migration/v27-developer-changes#builder-util-runtime-cross-origin-headers #10562 0afbb44 — builder-util-runtime

  • Fix(runtime): the reject that CancellationToken.createPromise passes to its callback takes any value, (error: unknown) => void, as a promise rejects with any value #10566 e955338 — builder-util-runtime

  • Fix(updater): every request of a differential download (single-range, multi-range and reading the embedded block map) follows redirects through ElectronHttpExecutor.addRedirectHandlers: a redirect target on another origin gets only the request headers the app's autoUpdater.crossOriginHeaders keeps, plus the request's own Accept and Range, so a pre-signed S3 or R2 redirect target accepts the range requests instead of rejecting them and forcing a full download. A single-range download requests its remaining ranges from the redirect target, while each multi-range request starts at the update URL, and at most 10 redirects are followed per request, as for every ElectronHttpExecutor request #10419 2d97c85 — updated in #10568

  • Fix(updater): name update file, blockmap and request URLs without their query in logs and error messages (Found version, Downloading update from, Differential download, the block map lines, the Squirrel.Mac proxy's fileToProxy, the API request error messages and the GitHub, private GitHub and GitLab providers' release and channel file errors), since a query can hold a pre-signed URL's signature or a feed token #10568 4e8d8cc — electron-updater, builder-util-runtime

  • Fix: state the rule and link its migration section in the errors for disabled web-installer updates and a missing update-manifest signing key #10576 95c3acd

  • Fix: the apt install log no longer claims allowUnverifiedLinuxPackages: false verifies a downloaded .deb; apt checks no signature on a local .deb file, so it now warns instead #10577 3f6323a

  • Fix(updater): stop downloading a blockmap as soon as it passes the blockmap size limit derived from the update's size, and abort its request (ERR_UPDATER_DOWNLOAD_SIZE_EXCEEDED); downloadToBuffer honors DownloadOptions.maxSize below its 500 MB limit #10579 96b222f — electron-updater, builder-util-runtime

  • Fix(mac): the local proxy that serves a downloaded update to Squirrel.Mac requires its credentials on every route (including the zip), compares them in constant time, answers only GET requests (a HEAD or POST gets a 405 and does not complete the download), rejects the download with ERR_UPDATER_MAC_PROXY_SERVER_FAILED when the proxy cannot listen, and logs request paths only at debug level #10581 04585d6

  • Fix(updater): stop a full update download once it receives more bytes than the file's size in the update info (ERR_UPDATER_DOWNLOAD_SIZE_EXCEEDED) #10580 ab396ea — electron-updater, builder-util-runtime

  • Fix(updater): the ERR_UPDATER_RESPONSE_TOO_LARGE error for a channel file (latest*.yml) larger than maxUpdateInfoSize links to https://www.electron.build/docs/migration/v27-runtime-changes#channel-files-are-limited-to-10-mib, which explains the 10 MiB default and how to raise it #10603 b5a4e64

  • Security hardening and a migrate-schema fix: #10036 b87a0b7 — electron-updater, builder-util-runtime · updated in #10603

    • builder-util removePassword: redact single-letter/URI secret flags (security … -k <password>, osslsigncode -key <pkcs11-uri?pin-value=…>) and whitespace-containing secrets in debug logs, and make the /b … /c block-redaction regex ReDoS-safe.
    • builder-util-runtime httpExecutor: the maxRedirects guard advances the redirect counter on every redirect, so a redirect loop from a malicious feed/mirror fails the request after 10 redirects.
    • electron-updater GitLabProvider: the GitLab token goes to a channel-file request on another origin than the GitLab host only when the app's autoUpdater.crossOriginHeaders keeps it, so an off-host direct_asset_url in the release JSON does not receive the token unless the app allows it.
    • app-builder-lib: defense-in-depth hardening — validate executableName before interpolating it into the generated Flatpak launcher, contain custom-toolset extraction within the cache dir, and XML-escape MSI file-association ext/description.
    • electron-builder migrate-schema: auto-remove the removed linux.syncDesktopName flag.
  • Fix(runtime): a failed download into a file (for example one stopped at its declared size, a lost connection or a timeout) is reported once the file is closed, so electron-updater removes the partly written file with the pending update instead of leaving a temp-* file behind when the failure came before the file had been opened, or while it was still open on Windows. A file whose close fails is reported as a failed download. #10605 e4ac7ae — electron-updater, builder-util-runtime

  • Docs(updater): ERR_UPDATER_NO_PUBLISHER_NAME is documented as what it is, an update config file that goes missing after a download read it (a packaged app without one fails the download, reading it), and autoUpdater.publisherName is named next to the win.verifyUpdateCodeSignature: false opt-out #10637 9eac366

  • Fix(updater): the packaged-app allowInsecureFeed warning links https://www.electron.build/docs/migration/v27-runtime-changes#update-requests-require-https, and the login warnings (no listener, a handler without the url argument answering another origin, a listener that threw) link https://www.electron.build/docs/migration/v27-runtime-changes#update-credentials-stay-on-the-feeds-origin, instead of the auto-update feature page #10634 83003b8

  • Fix(updater): the ERR_UPDATER_ZIP_FILE_NOT_FOUND, ERR_UPDATER_NO_CHECKSUM and ERR_UPDATER_NO_FILES_PROVIDED errors name the update files by URL without the query (which can hold a pre-signed URL's signature or a feed token), instead of dumping the update info #10632 1e3a367

  • Fix(updater): naming a missing or non-string URL in an error message (such as a latest*.yml file entry without a url) no longer throws a TypeError that replaces the coded error #10632 1e3a367 — builder-util-runtime