Conversation
|
Seems like this upgrade is somehow causing electron-userland/electron-builder#9394 |
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
|
Blocked on electron-userland/electron-builder#9603 |
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
| // Pick the version out of yarn berry patch syntax | ||
| // "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch" | ||
| if (updaterVersion.startsWith("patch:")) { | ||
| const match = updaterVersion.match(/@npm%3A(.+?)#/) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
| redirectCount = 0 | ||
| ): Promise<string> { | ||
| if (debug.enabled) { | ||
| debug(`Request: ${safeStringifyJson(options)}`) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 7 hours ago
In general, the safest approach is to avoid logging full request objects that may contain secrets. Instead, log only non‑sensitive metadata (HTTP method, hostname, path, timeout, etc.), or ensure that any logging that could include secrets uses a robust redaction mechanism with explicit allow‑listing of fields.
Here, the best minimal fix without changing behavior of HTTP requests is to change doApiRequest’s debug logging so that it does not stringify the entire options object. We can log only a subset of fields that are not sensitive (e.g., method, hostname, path, port, timeout) and omit headers entirely. This avoids the need to rely on safeStringifyJson’s heuristic, and ensures that authentication data coming from process.env can no longer reach the log sink at all.
Concretely, in electron-builder/packages/builder-util-runtime/src/httpExecutor.ts, within HttpExecutor.doApiRequest, replace:
if (debug.enabled) {
debug(`Request: ${safeStringifyJson(options)}`)
}with a call that logs a safe subset, for example:
if (debug.enabled) {
const { method, hostname, path, port, timeout } = options
debug(
`Request: ${JSON.stringify(
{ method, hostname, path, port, timeout },
null,
2
)}`
)
}This change is limited to the logging and does not affect request execution. No new imports or utilities are needed; we can use JSON.stringify directly and avoid touching safeStringifyJson itself (which may be used elsewhere).
| @@ -109,7 +109,14 @@ | ||
| redirectCount = 0 | ||
| ): Promise<string> { | ||
| if (debug.enabled) { | ||
| debug(`Request: ${safeStringifyJson(options)}`) | ||
| const { method, hostname, path, port, timeout } = options | ||
| debug( | ||
| `Request: ${JSON.stringify( | ||
| { method, hostname, path, port, timeout }, | ||
| null, | ||
| 2 | ||
| )}` | ||
| ) | ||
| } | ||
|
|
||
| return cancellationToken.createPromise<string>((resolve, reject, onCancel) => { |
| requestProcessor: (request: T, reject: (error: Error) => void) => void | ||
| ) { | ||
| if (debug.enabled) { | ||
| debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 7 hours ago
In general, the fix is to ensure that logs never contain sensitive information, especially anything derived from secrets or environment configuration. For this case, the problematic sink is the response logging in HttpExecutor.handleResponse. We should avoid logging the full RequestOptions structure there, and instead log only a minimal, non-sensitive subset (status code, method, hostname, and a truncated path), or rely on upstream logging that already covers the request.
The best minimal-impact fix is:
- Leave
safeStringifyJsonas-is (it’s used in other contexts). - Change
handleResponseso it no longer logssafeStringifyJson(options). Instead, log a short message that includes only:response.statusCodeandresponse.statusMessageoptions.methodoptions.hostname- a possibly truncated
options.path(to avoid leaking long query strings that could contain identifiers)
- This keeps the ability to debug HTTP responses while removing the path for sensitive data to reach logs.
Concretely:
- File to edit:
electron-builder/packages/builder-util-runtime/src/httpExecutor.ts - In
HttpExecutor.handleResponse, replace:with something like:if (debug.enabled) { debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`) }
if (debug.enabled) { const { method, hostname, path } = options const safePath = typeof path === "string" && path.length > 200 ? path.substring(0, 200) + "…" : path debug(`Response: ${response.statusCode} ${response.statusMessage} (method: ${method || "GET"}, host: ${hostname}, path: ${safePath})`) }
- No new imports are needed; we only use basic string operations.
No changes are required in ArtifactPublisherTest.ts or keygenPublisher.ts because the primary risky logging occurs in httpExecutor.ts.
| @@ -153,7 +153,11 @@ | ||
| requestProcessor: (request: T, reject: (error: Error) => void) => void | ||
| ) { | ||
| if (debug.enabled) { | ||
| debug(`Response: ${response.statusCode} ${response.statusMessage}, request options: ${safeStringifyJson(options)}`) | ||
| const { method, hostname, path } = options | ||
| const safePath = typeof path === "string" && path.length > 200 ? path.substring(0, 200) + "…" : path | ||
| debug( | ||
| `Response: ${response.statusCode} ${response.statusMessage} (method: ${method || "GET"}, host: ${hostname}, path: ${safePath})` | ||
| ) | ||
| } | ||
|
|
||
| // we handle any other >= 400 error on request end (read detailed message in the response body) |
| ].includes(level) | ||
| ) { | ||
| // log error message to console so VITEST can capture stacktrace as well | ||
| console.log(message, fields) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
| return s | ||
| } | ||
|
|
||
| return `"${s.replace(/"/g, '\\"')}"` |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 7 hours ago
To fix the problem in general, the escaping routine should escape both double quotes and backslashes in a consistent way, so that any backslash in the original string cannot accidentally act as an escape for a following meta-character. This means replacing each single backslash with a double backslash, then replacing double quotes with an escaped form, before wrapping the entire string in quotes.
Concretely, in electron-builder/packages/electron-builder/src/cli/create-self-signed-cert.ts, we should update quoteString so it first escapes backslashes and then escapes double quotes. The function’s logic determining whether quoting is needed (if (!s.includes(",") && !s.includes('"'))) remains unchanged to preserve current behavior for simple names. Only the return statement should be adjusted so that s is transformed by both s.replace(/\\/g, "\\\\") and s.replace(/"/g, '\\"'), for example by chaining the replace calls. No additional imports or helpers are required.
| @@ -38,5 +38,5 @@ | ||
| return s | ||
| } | ||
|
|
||
| return `"${s.replace(/"/g, '\\"')}"` | ||
| return `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` | ||
| } |
| import { Provider, ProviderRuntimeOptions } from "./providers/Provider" | ||
|
|
||
| export function isUrlProbablySupportMultiRangeRequests(url: string): boolean { | ||
| return !url.includes("s3.amazonaws.com") |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 7 hours ago
In general, instead of checking url.includes("host"), parse the URL and only check the hostname (or host) field so that hostPattern cannot be matched from the path/query/fragment or from unrelated hostnames. This avoids false positives where "s3.amazonaws.com" appears outside the actual host.
For this specific case, we should replace the substring check in isUrlProbablySupportMultiRangeRequests with logic that parses the URL and inspects the hostname. Using Node’s standard URL class is sufficient and does not require new dependencies. We should treat any URL whose hostname is exactly s3.amazonaws.com or ends with .s3.amazonaws.com as S3-like, and return false in that case; for all other hosts (or unparsable URLs) we keep the previous default behavior (true, meaning "probably supports multi-range requests"). To maintain robustness, wrap URL parsing in a try/catch and fall back to true (i.e., do not disable multi-range) if parsing fails.
Concretely in electron-builder/packages/electron-updater/src/providerFactory.ts:
- Update
isUrlProbablySupportMultiRangeRequeststo:- Attempt
new URL(url)and gethostname. - If
hostname === "s3.amazonaws.com"orhostname.endsWith(".s3.amazonaws.com"), returnfalse. - Otherwise return
true.
- Attempt
- No other code needs modification, and no new imports are required because
URLis globally available in modern Node/Electron environments.
| @@ -21,7 +21,16 @@ | ||
| import { Provider, ProviderRuntimeOptions } from "./providers/Provider" | ||
|
|
||
| export function isUrlProbablySupportMultiRangeRequests(url: string): boolean { | ||
| return !url.includes("s3.amazonaws.com") | ||
| try { | ||
| const parsed = new URL(url) | ||
| const hostname = parsed.hostname | ||
| const isS3Amazonaws = | ||
| hostname === "s3.amazonaws.com" || hostname.endsWith(".s3.amazonaws.com") | ||
| return !isS3Amazonaws | ||
| } catch { | ||
| // If the URL cannot be parsed, fall back to assuming multi-range is supported | ||
| return true | ||
| } | ||
| } | ||
|
|
||
| export function createClient(data: PublishConfiguration | AllPublishOptions, updater: AppUpdater, runtimeOptions: ProviderRuntimeOptions): Provider<any> { |
| config: { | ||
| toolsets, | ||
| cscLink: protectedCscLink, | ||
| cscKeyPassword: "test", |
Check failure
Code scanning / SonarCloud
Credentials should not be hard-coded High test
| config: { | ||
| toolsets, | ||
| cscLink: protectedCscLink, | ||
| cscKeyPassword: "test", |
Check failure
Code scanning / SonarCloud
Credentials should not be hard-coded High test
| config: { | ||
| toolsets, | ||
| cscLink: protectedCscLink, | ||
| cscKeyPassword: "test", |
Check failure
Code scanning / SonarCloud
Credentials should not be hard-coded High test
| config: { | ||
| toolsets, | ||
| cscLink: protectedCscLink, | ||
| cscKeyPassword: "test", |
Check failure
Code scanning / SonarCloud
Credentials should not be hard-coded High test
| }, | ||
| win: { | ||
| signtoolOptions: { | ||
| certificatePassword: "pass", |
Check failure
Code scanning / SonarCloud
Credentials should not be hard-coded High test
| .replace(/{{/g, "<%") | ||
| .replace(/}}/g, "%>") | ||
| .replace(/\${([^}]+)}/g, "<%=$1%>") | ||
| return ejs.compile(template) |
Check warning
Code scanning / SonarCloud
Templates should not be constructed dynamically Medium
| # cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read |
Check notice
Code scanning / SonarCloud
Read permissions should be defined at the job level Low test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This PR contains the following updates:
10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264→10.29.3Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
pnpm/pnpm (pnpm)
v10.29.3Compare Source
v10.29.2Compare Source
v10.29.1: pnpm 10.29.1Compare Source
Minor Changes
pnpm dlx/pnpxcommand now supports thecatalog:protocol. Example:pnpm dlx shx@catalog:.auditLevelin thepnpm-workspace.yamlfile #10540.workspace:protocol without version specifier. It is now treated asworkspace:*and resolves to the concrete version during publish #10436.Patch Changes
Fixed
pnpm list --jsonreturning incorrect paths when using global virtual store #10187.Fix
pnpm store pathandpnpm store statususing workspace root for path resolution whenstoreDiris relative #10290.Fixed
pnpm run -rfailing with "No projects matched the filters" when an emptypnpm-workspace.yamlexists #10497.Fixed a bug where
catalogMode: strictwould write the literal string"catalog:"topnpm-workspace.yamlinstead of the resolved version specifier when re-adding an existing catalog dependency #10176.Fixed the documentation URL shown in
pnpm completion --helpto point to the correct page at https://pnpm.io/completion #10281.Skip local
file:protocol dependencies duringpnpm fetch. This fixes an issue wherepnpm fetchwould fail in Docker builds when local directory dependencies were not available #10460.Fixed
pnpm audit --jsonto respect the--audit-levelsetting for both exit code and output filtering #10540.update tar to version 7.5.7 to fix security issue
Updating the version of dependency tar to 7.5.7 because the previous one have a security vulnerability reported here: CVE-2026-24842
Fix
pnpm audit --fixreplacing reference overrides (e.g.$foo) with concrete versions #10325.Fix
shamefullyHoistset viaupdateConfigin.pnpmfile.cjsnot being converted topublicHoistPattern#10271.pnpm helpshould correctly report if the currently running pnpm CLI is bundled with Node.js #10561.Add a warning when the current directory contains the PATH delimiter character. On macOS, folder names containing forward slashes (/) appear as colons (:) at the Unix layer. Since colons are PATH separators in POSIX systems, this breaks PATH injection for
node_modules/.bin, causing binaries to not be found when running commands likepnpm exec#10457.Platinum Sponsors
Gold Sponsors
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.