security: remediate dependency and code scanning alerts

Upgrade vulnerable transitive dependencies and harden filesystem, URL, HTML, cryptographic, and input-processing boundaries identified by security scans.
This commit is contained in:
neon
2026-07-15 17:34:54 +00:00
parent 876e32654a
commit f6394a9b0c
46 changed files with 792 additions and 472 deletions
+7 -4
View File
@@ -142,10 +142,7 @@ function normalizeResolverOptions(options?: PathResolverOptions): Required<PathR
}
export function sanitizePathSegment(value: string, replacementCharacter: "_" | "-" = "_"): string {
let sanitized = value
.replace(INVALID_SEGMENT_CHARS_REGEX, replacementCharacter)
.trim()
.replace(/[. ]+$/g, "");
let sanitized = stripTrailingDotsAndSpaces(value.replace(INVALID_SEGMENT_CHARS_REGEX, replacementCharacter).trim());
if (!sanitized || sanitized === "." || sanitized === "..") {
sanitized = replacementCharacter;
}
@@ -158,6 +155,12 @@ export function sanitizePathSegment(value: string, replacementCharacter: "_" | "
return sanitized;
}
function stripTrailingDotsAndSpaces(value: string): string {
let end = value.length;
while (end > 0 && (value[end - 1] === "." || value[end - 1] === " ")) end -= 1;
return end === value.length ? value : value.slice(0, end);
}
function sanitizeResolutionValues(values: Record<string, string>, options: Required<PathResolverOptions>): Record<string, string> {
if (!options.sanitizeForCrossPlatform) return values;