mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
* fix(security): upgrade direct ZIP readers to 9.0.5 Upgrade the app, native narration reader and Windows thumbnail provider; adapt fallible filenames and optional data offsets. Update both app lockfiles and the thumbnail lock while preserving unrelated pins. Verified: 201 app Rust tests, 24 native TTS tests, 6 thumbnail tests under Wine (1 existing ignored), strict app clippy, formatting and locked CEF Linux dependency graph. Thumbnail strict clippy reproduces 3 existing lints on the original source; it passes with those CLI lint allowances. CEF compilation and native Windows device testing were not run. This is a dependency/API migration covered by existing archive tests; no new application behavior is intended. The Windows updater retains ZIP 4 because its patched release requires an incompatible Tauri family. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(security): update vulnerable JavaScript dependencies Raise patched dependency floors, scope the modern minimatch upgrade to v10 consumers, and patch deepmerge prototype writes in both merge loops. Upgrade the SVG renderer and keep its font shaper external so Node can load its WASM asset when generating PNGs. Regression tests fail before the fixes: deepmerge inherits attacker properties; minimatch expands 256 patterns instead of 64 and performs 500500 comparisons instead of zero. The unpatched image upgrade fails with a dynamic require of fs / missing hb.wasm. All 31 new tests pass with the fixes, including actual translation and PDF vendor consumers. Verified: full unit suite 14714 passed/16 skipped; final focused tests 31 passed; lint, formatting, frozen install, web build and Tauri frontend build passed. Final web build was repeated after the renderer patch. Nix hashes still need CI regeneration; CEF compilation was not run. Version-based audits still flag patched deepmerge and legacy minimatch 3/5, which lack this advisory's vulnerable optimizer. Co-Authored-By: Claude Code <noreply@anthropic.com> * build(nix): request fresh security dependency hashes Invalidate the pnpm and Cargo fixed-output hashes so the PR dependency check computes the updated stores instead of substituting old cached stores. Replace both values with the CI-reported hashes before merge. Verified the diff changes only the two affected hash fields; local Nix is unavailable. CI verification is pending on this commit. Co-Authored-By: Claude Code <noreply@anthropic.com> * build(nix): pin regenerated security dependency hashes Use the pnpm and Cargo hashes calculated by the PR dependency check (run 41428540045). Both fetchers completed and reported their actual fixed-output hashes. Replace the temporary empty values. Verified against the CI log's pnpm-deps and vendor-staging got values; git diff --check passes. The final hash-check rerun is pending. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
90 lines
2.7 KiB
Diff
90 lines
2.7 KiB
Diff
diff --git a/index.js b/index.js
|
|
--- a/index.js
|
|
+++ b/index.js
|
|
@@ -44,6 +44,10 @@ function propertyIsOnObject(object, property) {
|
|
}
|
|
}
|
|
|
|
+function propertyIsForbidden(key) {
|
|
+ return key === '__proto__'
|
|
+}
|
|
+
|
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
function propertyIsUnsafe(target, key) {
|
|
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
|
@@ -55,11 +59,14 @@ function mergeObject(target, source, options) {
|
|
var destination = {}
|
|
if (options.isMergeableObject(target)) {
|
|
getKeys(target).forEach(function(key) {
|
|
+ if (propertyIsForbidden(key)) {
|
|
+ return
|
|
+ }
|
|
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
|
|
})
|
|
}
|
|
getKeys(source).forEach(function(key) {
|
|
- if (propertyIsUnsafe(target, key)) {
|
|
+ if (propertyIsForbidden(key) || propertyIsUnsafe(target, key)) {
|
|
return
|
|
}
|
|
|
|
diff --git a/dist/cjs.js b/dist/cjs.js
|
|
--- a/dist/cjs.js
|
|
+++ b/dist/cjs.js
|
|
@@ -69,6 +69,10 @@ function propertyIsOnObject(object, property) {
|
|
}
|
|
}
|
|
|
|
+function propertyIsForbidden(key) {
|
|
+ return key === '__proto__'
|
|
+}
|
|
+
|
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
function propertyIsUnsafe(target, key) {
|
|
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
|
@@ -80,11 +84,14 @@ function mergeObject(target, source, options) {
|
|
var destination = {};
|
|
if (options.isMergeableObject(target)) {
|
|
getKeys(target).forEach(function(key) {
|
|
+ if (propertyIsForbidden(key)) {
|
|
+ return
|
|
+ }
|
|
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
});
|
|
}
|
|
getKeys(source).forEach(function(key) {
|
|
- if (propertyIsUnsafe(target, key)) {
|
|
+ if (propertyIsForbidden(key) || propertyIsUnsafe(target, key)) {
|
|
return
|
|
}
|
|
|
|
diff --git a/dist/umd.js b/dist/umd.js
|
|
--- a/dist/umd.js
|
|
+++ b/dist/umd.js
|
|
@@ -75,6 +75,10 @@
|
|
}
|
|
}
|
|
|
|
+ function propertyIsForbidden(key) {
|
|
+ return key === '__proto__'
|
|
+ }
|
|
+
|
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
function propertyIsUnsafe(target, key) {
|
|
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
|
@@ -86,11 +90,14 @@
|
|
var destination = {};
|
|
if (options.isMergeableObject(target)) {
|
|
getKeys(target).forEach(function(key) {
|
|
+ if (propertyIsForbidden(key)) {
|
|
+ return
|
|
+ }
|
|
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
});
|
|
}
|
|
getKeys(source).forEach(function(key) {
|
|
- if (propertyIsUnsafe(target, key)) {
|
|
+ if (propertyIsForbidden(key) || propertyIsUnsafe(target, key)) {
|
|
return
|
|
}
|
|
|