Repository navigation
electron-updater@7.0.0-alpha.14
Pre-releaseMajor 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-yamldumpwithoutnoRefs) 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 withERR_UPDATER_INVALID_UPDATE_INFO(wasERR_UPDATER_LATEST_VERSION_NOT_FOUND). TheERR_UPDATER_INVALID_UPDATE_INFOmessages name the channel file URL without its query string, so a token in the feed URL is not logged.#10514a61262c -
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 withERR_UPDATER_UNSAFE_INSTALLER_PATHbefore the helper runs. pkexec and sudo take any path.#10524d996835 -
Feat(updater)!: the app chooses the request headers sent to another origin with the required
autoUpdater.crossOriginHeadersproperty:(headerNames: string[], hop: { from: URL; to: URL }) => string[](theCrossOriginHeadersCallbackandCrossOriginHoptypes),nullby 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:AuthorizationfromaddAuthHeader, a custom header fromrequestHeaders, a provider's token (private GitHub, GitLab), a provider's other request headers andx-user-staging-id. The headers electron-updater builds for each request itself are sent whatever it returns: its defaultUser-Agent,Cache-Control, theAcceptit or the provider sets, andRange; an app's ownUser-AgentfromrequestHeadersgoes to another origin only when it keepsuser-agent.autoUpdater.crossOriginHeaders = () => []sends none of the app's headers to another origin. Without a function,checkForUpdates(),checkForUpdatesAndNotify()anddownloadUpdate()emiterrorand reject withERR_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 isready. An unpackaged app withoutforceDevUpdateConfig, which skips the check, gets the same error fromcheckForUpdates()andcheckForUpdatesAndNotify(), so a missing callback shows up in development. A throw, or a result that is not an array of strings, fails that request, unsent, withERR_UPDATER_INVALID_CROSS_ORIGIN_HEADERS. builder-util-runtime:HttpExecutortakes aCrossOriginHeaderPolicy((headers, hop) => headers) for its redirects as its constructor argument, by default electron-builder's, which leaves out the credential-bearing headers (seeaddSensitiveRedirectHeader);HttpExecutor.crossOriginHeaders(headers, ownHeaders, hop, policy)applies one, andApiRequestOptions.ownHeadersandDownloadOptions.ownHeadersname the headers a request builds itself, which a hop to another origin sends whatever the policy keeps. electron-updater'sProviderRuntimeOptionshas a requiredcrossOriginHeaderPolicy, 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. AHostheader is never sent to another origin. A provider constructed with runtime options without acrossOriginHeaderPolicyfunction throwsERR_UPDATER_CROSS_ORIGIN_HEADER_POLICY_MISSING. See https://www.electron.build/docs/migration/v27-runtime-changes#cross-origin-headers#10563d699bdf—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[].urlorpackages.<arch>.pathinlatest*.yml, a GitLab release asset link, and the blockmaps and differential range requests derived from them — is requested with only the headers fromrequestHeaders/addAuthHeaderthat the app'sautoUpdater.crossOriginHeaderskeeps (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 afiles[].urlor a blockmap) gets the feed query only on the feed's origin; as on redirects, anhttp→httpsupgrade 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-setpreviousBlockmapBaseUrlOverridegets every request header on that origin. If yourlatest*.ymlpoints 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 inautoUpdater.crossOriginHeaders. The NSIS web-package differential download uses the same per-download headers as other downloads. Every provider returns its feed URL fromProvider.feedBaseUrl: the built-in ones return theirs (private GitHub returns the GitHub API, whose asset URLs need its token), and a custom provider whosefeedBaseUrlis not a URL,nullincluded, fails the update check withERR_UPDATER_FEED_BASE_URL_NOT_DECLAREDbefore 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.crossOriginHeadersandHttpExecutor.isCrossOrigin.#10270ec9135d—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_FEEDunless the app setsAppUpdater.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 toapp-update.yml(a generic or custom publishurl, a githubprotocol: "http"or an s3endpointwithoutaccelerate) uses plain http to a host that is not loopback. WithallowInsecureFeed, a server's authentication challenge on a request that is neither https nor to a loopback host is cancelled without emittinglogin. A redirect to a loopback host (http or https) from a URL that is not on one fails withERR_UPDATER_LOOPBACK_REDIRECT, whateverallowInsecureFeedis;ApiRequestOptions.redirectedFromNonLoopbackcarries that through a redirect chain. https://www.electron.build/docs/migration/v27-runtime-changes#update-requests-require-https#10566e955338—electron-updater,builder-util-runtime -
Feat(nsis)!: an
nsis-webinstaller started as an update (--updated) without--package-fileaborts (exit code 2), electron-updater rejects a web-installer update without a package for the app's arch oria32before 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)#1060103cf406
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 withERR_UPDATER_RESPONSE_TOO_LARGE.maxUpdateInfoSizein the publish configuration (written intoapp-update.yml) orautoUpdater.maxUpdateInfoSizesets the limit in bytes, or0for none.#10508c79e07c—electron-updater,builder-util-runtime - Feat(updater): the
loginevent 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 byauthInfo.isProxy. Aloginhandler cancels a challenge by callingcallback()without credentials, and without aloginlistener 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 nologinhandler takes theurlargument. 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#105651b4b37c - Feat(runtime):
HttpExecutor.addRedirectHandlersis 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#104192d97c85—builder-util-runtime· updated in#10568 - Feat(updater): optional
files[].blockMapUrlinlatest*.ymlnames a file's blockmap URL (e.g. a separately pre-signed one) instead of${url}.blockmapwith the file URL's query string. A relative value resolves likeurl(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'sautoUpdater.crossOriginHeaderskeeps. With ablockMapUrl, the old blockmap is not derived from the new file's URL: it comes from the local cache, else frompreviousBlockmapBaseUrlOverride, else that update is downloaded in full (which caches the new blockmap). The manifest signature coversblockMapUrlwhen 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.#10270ec9135d—electron-updater,builder-util-runtime· updated in#10568 - Feat(updater): add
NsisUpdater.publisherName(autoUpdater.publisherName, defaultnull), the subject(s) of the certificate that signs your updates, to verify an NSIS update against when the update config has nopublisherName. ThepublisherNameofapp-update.ymlwins over it, and it wins oververifyUpdateCodeSignature: 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 apublisherName#10600a69c30a
Patch Changes
-
Remove the
lodash.isequaldependency: the in-memory check for an already downloaded update compares the update info withutil.isDeepStrictEqual.#10484ea85d41 -
Feat:
blockMapV2ToV3Keys(internal) converts a parsed v2 block map to the block keystoBlockMapgives 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#1049739db76f—builder-util-runtime -
Feat: the first update after an app switches its
.blockmapformat (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 atinfo)#1049739db76f -
Fix(runtime): a download follows a
Locationheader 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"#10505c5b5895—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
#105122cddd42 -
Fix(updater): parse the boundary of a
multipart/byterangesContent-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#105132cdcc45 -
Fix(updater): install an update deferred with
quitAndInstall({ waitUntilNextLaunch: true })at the next launch with anyautoInstallEventbut"manual", once the app's ownreadyhandlers have run#105252e10208 -
Fix(updater): keep
autoUpdaterworking when electron-updater is bundled into the main process (Vite/Rollup, esbuild)#10531f8d6d61 -
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
#10511fcf5e61 -
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
#10515bfd6405—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
#1051713d953d—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#1052696e0644 -
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
#10506be288a8—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#1050936f0536—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"
#105102a5a06f—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 achannelthat is a URL, sends only the request headers (fromrequestHeaders/addAuthHeader) that the app'sautoUpdater.crossOriginHeaderskeeps, the same rule as for downloads, so credential headers such asAuthorizationstay on the feed's origin unless it keeps them; so does a provider's ownhttpRequestto another origin than itsfeedBaseUrl, the headers of itsheadersargument included, apart from itsAccept#105203add3dc -
Fix(updater): when a signed update manifest with a
stagingPercentagefails verification, say thatstagingPercentageis covered by the signature and link the staged-rollout docs, which now explain how to signlatest*.ymlagain after changing it#10530e56fd9a -
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 withERR_UPDATER_INVALID_UPDATE_INFO#1052207d5b19 -
Fix(updater): count YAML aliases against the update manifest's alias budget while the manifest is loaded, so a
latest*.ymlwhose non-scalar mapping keys (? [*a, *a, ...]) expand into very long strings is rejected withERR_UPDATER_INVALID_UPDATE_INFObefore 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#10536896ba56 -
Fix: a download that fails with a status of 400 or above rejects with an
HttpErrorcarryingstatusCodeandcode: "HTTP_ERROR_<status>", and its message leaves out the URL's query string and hash so signed links don't reach logs#10549141bb9b—builder-util-runtime -
Fix:
HttpExecutor.crossOriginHeaderscopies the headers withdeepAssign, which ignores__proto__,constructorandprototypekeys#10270ec9135d—builder-util-runtime· updated in#10563 -
Fix(runtime): a cross-origin redirect drops the request
authoption (Basic credentials), whatever headers it keeps, so it goes only to the original origin; withDEBUG=electron-buildera debug line names both origins. https://www.electron.build/docs/migration/v27-developer-changes#builder-util-runtime-cross-origin-headers#105620afbb44—builder-util-runtime -
Fix(runtime): the
rejectthatCancellationToken.createPromisepasses to its callback takes any value,(error: unknown) => void, as a promise rejects with any value#10566e955338—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'sautoUpdater.crossOriginHeaderskeeps, plus the request's ownAcceptandRange, 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 everyElectronHttpExecutorrequest#104192d97c85— 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'sfileToProxy, 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#105684e8d8cc—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
#1057695c3acd -
Fix: the apt install log no longer claims
allowUnverifiedLinuxPackages: falseverifies a downloaded.deb; apt checks no signature on a local.debfile, so it now warns instead#105773f6323a -
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);downloadToBufferhonorsDownloadOptions.maxSizebelow its 500 MB limit#1057996b222f—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_FAILEDwhen the proxy cannot listen, and logs request paths only at debug level#1058104585d6 -
Fix(updater): stop a full update download once it receives more bytes than the file's
sizein the update info (ERR_UPDATER_DOWNLOAD_SIZE_EXCEEDED)#10580ab396ea—electron-updater,builder-util-runtime -
Fix(updater): the
ERR_UPDATER_RESPONSE_TOO_LARGEerror for a channel file (latest*.yml) larger thanmaxUpdateInfoSizelinks 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#10603b5a4e64 -
Security hardening and a migrate-schema fix:
#10036b87a0b7—electron-updater,builder-util-runtime· updated in#10603builder-utilremovePassword: 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 … /cblock-redaction regex ReDoS-safe.builder-util-runtimehttpExecutor: themaxRedirectsguard advances the redirect counter on every redirect, so a redirect loop from a malicious feed/mirror fails the request after 10 redirects.electron-updaterGitLabProvider: the GitLab token goes to a channel-file request on another origin than the GitLab host only when the app'sautoUpdater.crossOriginHeaderskeeps it, so an off-hostdirect_asset_urlin the release JSON does not receive the token unless the app allows it.app-builder-lib: defense-in-depth hardening — validateexecutableNamebefore interpolating it into the generated Flatpak launcher, contain custom-toolset extraction within the cache dir, and XML-escape MSI file-associationext/description.electron-buildermigrate-schema: auto-remove the removedlinux.syncDesktopNameflag.
-
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.#10605e4ac7ae—electron-updater,builder-util-runtime -
Docs(updater):
ERR_UPDATER_NO_PUBLISHER_NAMEis 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), andautoUpdater.publisherNameis named next to thewin.verifyUpdateCodeSignature: falseopt-out#106379eac366 -
Fix(updater): the packaged-app
allowInsecureFeedwarning links https://www.electron.build/docs/migration/v27-runtime-changes#update-requests-require-https, and theloginwarnings (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#1063483003b8 -
Fix(updater): the
ERR_UPDATER_ZIP_FILE_NOT_FOUND,ERR_UPDATER_NO_CHECKSUMandERR_UPDATER_NO_FILES_PROVIDEDerrors 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#106321e3a367 -
Fix(updater): naming a missing or non-string URL in an error message (such as a
latest*.ymlfile entry without aurl) no longer throws aTypeErrorthat replaces the coded error#106321e3a367—builder-util-runtime