@_linked/server 2.7.5 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # @\_linked/server
2
2
 
3
+ ## 2.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#65](https://github.com/linked-fw/server/pull/65) [`85d61d1`](https://github.com/linked-fw/server/commit/85d61d107af292d2b6e02d73bb41251248239d2c) Thanks [@flyon](https://github.com/flyon)! - Upgrade `sharp` to ^0.35.4 and drop the unused `adm-zip` dependency.
8
+
9
+ `sharp` was pinned to `^0.34.4`, which resolves to a build carrying the libvips
10
+ advisories CVE-2026-33327, -33328, -35590 and -35591. This is not a
11
+ tooling-only exposure: `LinkedServer` imports `sharp` at module top level and
12
+ registers `GET /resized/*` **before** the `apiOnly` guard, so the handler is
13
+ live in an API-only deployment too. It fetches a URL and pipes the bytes
14
+ straight into `sharp()`, which makes those the only advisories in this package
15
+ reachable from a request.
16
+
17
+ `^0.35.4` is a semver-major for sharp, but the surface used here —
18
+ `sharp(buffer|path)`, `.metadata()`, `.resize(w, h)`, `.toFormat(fmt, opts)`,
19
+ `.toBuffer()` and `.toFile()` — is unchanged between the two. Verified by
20
+ exercising exactly those calls against jpeg, png and webp, through both the
21
+ buffer branch and the `toFile` branch. sharp 0.35 requires Node >= 20.9.
22
+
23
+ Flagged `minor` rather than `patch` because sharp 0.35 drops some older
24
+ platform prebuilds; consumers on an unusual target should check that a binary
25
+ exists for theirs.
26
+
27
+ Five declared dependencies are removed, each referenced nowhere in the package:
28
+ `adm-zip`, `archiver`, `zip-a-folder`, `node-hook` and `is-object`. Only
29
+ `adm-zip` carried advisories -- three of them, so that is three fewer for every
30
+ consumer. The other four are weight rather than risk: 38 fewer packages in a
31
+ consumer's tree.
32
+
33
+ Note for whoever picks it up next: `resizeImage` still fetches an arbitrary
34
+ `req.query.src` server-side. The `// TODO: restrict resizing to images that are
35
+ stored by LinkedFileStorage` above it is an unfixed SSRF and is arguably a
36
+ bigger problem than the libvips CVEs this change closes. Deliberately left
37
+ alone here rather than mixed into a dependency bump.
38
+
39
+ ## 2.8.0
40
+
41
+ ### Minor Changes
42
+
43
+ - [#63](https://github.com/linked-fw/server/pull/63) [`10a61bb`](https://github.com/linked-fw/server/commit/10a61bb7bcd2d85c24abc108ce86ac7bdfa51472) Thanks [@flyon](https://github.com/flyon)! - `LocalFileStore` suffixes only on a real collision, and `listFiles` returns keys you can use.
44
+
45
+ **`preventDuplicates` now means what its name says.** The random `_ab12cd` suffix
46
+ was applied to _every_ save, without ever checking whether the name was taken —
47
+ so a caller never got back the key it asked for. A content-hashed bundle handed
48
+ over as `main-hwqwrAvA.css` landed as `main-hwqwrAvA_x9k2ml.css`, and the name
49
+ baked into the HTML no longer resolved. `@_linked/cli` publishes app assets with
50
+ a bare two-argument `saveFile`, so it hit exactly this.
51
+
52
+ The store now checks first and suffixes only when the name is occupied,
53
+ re-checking the suffixed name in turn. **The never-clobber guarantee is
54
+ unchanged** — a taken name still gets a fresh key, and an explicit
55
+ `preventDuplicates: false` still overwrites in place. What changes is that a free
56
+ name is left alone, which is what `S3FileStore` has always done: the two
57
+ implementations of `IFileStore` now read the flag the same way.
58
+
59
+ Minor rather than patch because stored keys change shape: a first save that used
60
+ to produce `report_312acb.pdf` now produces `report.pdf`. Anything that recorded
61
+ a returned `storedPath` keeps working; anything that _assumed_ every key carries
62
+ a suffix should re-read `storedPath`, which has always been the supported way to
63
+ learn the key.
64
+
65
+ **`listFiles` is usable for the first time.** It returned keys joined onto
66
+ `basePath` (`data/uploads/x.txt`) while every other method on the store resolves
67
+ its argument _against_ `basePath` — so feeding a result straight back into
68
+ `getFile` looked for `data/uploads/data/uploads/x.txt` and found nothing. Keys
69
+ are now relative to the base folder, matching `S3FileStore`, which strips its
70
+ bucket prefix before returning.
71
+
72
+ Two more bugs went with it: the recursive branch called `listFiles(prefix)`,
73
+ which re-read `basePath` and found the same directory again — unbounded
74
+ recursion as soon as the store held a single folder — and the `prefix` argument
75
+ was accepted and then ignored entirely. Subdirectories are now walked properly
76
+ and `prefix` filters the returned keys.
77
+
3
78
  ## 2.7.5
4
79
 
5
80
  ### Patch Changes
@@ -56,11 +56,19 @@ export declare class LocalFileStore implements IFileStore {
56
56
  */
57
57
  getFile(filePath: string): Promise<Buffer | null>;
58
58
  /**
59
- * List all files in the local filesystem, relative to the base upload folder
60
- * @param recursive Whether or not to search all subdirectories recursively
61
- * @returns A promise that resolves to a list of file paths, relative to the base upload folder
62
- * @todo Think about taking an options parameter instead of positional args
63
- * @todo Take a path parameter to list files in a subdirectory
59
+ * List every file in the store, recursively.
60
+ *
61
+ * @param prefix Only return keys starting with this string. Matched against
62
+ * the returned (relative) key, so `listFiles('images/')` selects the
63
+ * `images` folder and `listFiles('main-')` selects by file name.
64
+ * @returns Keys relative to the base folder, exactly as `getFile`,
65
+ * `fileExists`, `deleteFile` and `statFile` expect them.
66
+ *
67
+ * The keys are relative on purpose: every other method on this store resolves
68
+ * its argument *against* `basePath`, so returning `data/uploads/x.txt` here
69
+ * meant a caller who fed the result straight back into `getFile` looked for
70
+ * `data/uploads/data/uploads/x.txt`. It also matches `S3FileStore`, which
71
+ * strips the bucket prefix before returning.
64
72
  */
65
73
  listFiles(prefix?: string): Promise<string[]>;
66
74
  /**
@@ -104,10 +112,11 @@ export declare class LocalFileStore implements IFileStore {
104
112
  * take. That is what `storedPath` is: hand it straight back to any of them.
105
113
  *
106
114
  * The key equals the `filePath` given verbatim — case included — as long as
107
- * the name needs no sanitising, already has an extension, and
108
- * `preventDuplicates` is `false`. With `preventDuplicates` left unspecified
109
- * (this store's default, kept for upload callers) a random suffix is added,
110
- * and `storedPath` is the only place that name is reported.
115
+ * the name needs no sanitising and already has an extension. With
116
+ * `preventDuplicates` left unspecified (this store's default, kept for upload
117
+ * callers) that still holds for a name nothing else occupies; only a name
118
+ * already taken gains a random suffix, and `storedPath` is the only place
119
+ * that name is reported.
111
120
  */
112
121
  saveFileWithPath(filePath: string, fileContent: Buffer, options?: SaveFileOptions | string, preventDuplicates?: boolean): Promise<SavedFileLocation>;
113
122
  /**
@@ -59,33 +59,44 @@ export class LocalFileStore {
59
59
  return fs.readFile(fileToGet).catch(() => null);
60
60
  }
61
61
  /**
62
- * List all files in the local filesystem, relative to the base upload folder
63
- * @param recursive Whether or not to search all subdirectories recursively
64
- * @returns A promise that resolves to a list of file paths, relative to the base upload folder
65
- * @todo Think about taking an options parameter instead of positional args
66
- * @todo Take a path parameter to list files in a subdirectory
62
+ * List every file in the store, recursively.
63
+ *
64
+ * @param prefix Only return keys starting with this string. Matched against
65
+ * the returned (relative) key, so `listFiles('images/')` selects the
66
+ * `images` folder and `listFiles('main-')` selects by file name.
67
+ * @returns Keys relative to the base folder, exactly as `getFile`,
68
+ * `fileExists`, `deleteFile` and `statFile` expect them.
69
+ *
70
+ * The keys are relative on purpose: every other method on this store resolves
71
+ * its argument *against* `basePath`, so returning `data/uploads/x.txt` here
72
+ * meant a caller who fed the result straight back into `getFile` looked for
73
+ * `data/uploads/data/uploads/x.txt`. It also matches `S3FileStore`, which
74
+ * strips the bucket prefix before returning.
67
75
  */
68
76
  async listFiles(prefix) {
69
- let files = await fs.readdir(this.basePath);
70
- // if (recursive) {
71
- const allFiles = await Promise.all(files.map((file) => {
72
- const filePath = path.join(this.basePath, file);
73
- return fs
74
- .stat(filePath)
75
- .then((stat) => {
76
- if (stat.isDirectory()) {
77
- return this.listFiles(prefix).then((files) => files.map((file) => path.join(filePath, file)));
78
- }
79
- else {
80
- return [filePath];
81
- }
82
- })
83
- .catch((err) => {
77
+ const walk = async (relativeDir) => {
78
+ const absoluteDir = path.join(this.basePath, relativeDir);
79
+ let entries;
80
+ try {
81
+ entries = await fs.readdir(absoluteDir, { withFileTypes: true });
82
+ }
83
+ catch (err) {
84
84
  console.warn('Error during listFiles', err);
85
85
  return [];
86
- });
87
- }));
88
- return allFiles.flat();
86
+ }
87
+ const nested = await Promise.all(entries.map((entry) => {
88
+ // path.join('', 'x') === 'x', so the top level stays unprefixed
89
+ const key = path.join(relativeDir, entry.name);
90
+ // recurse into the subdirectory itself. This used to call
91
+ // listFiles(prefix), which re-read basePath and so found the same
92
+ // directory again -- unbounded recursion as soon as the store held
93
+ // one folder.
94
+ return entry.isDirectory() ? walk(key) : Promise.resolve([key]);
95
+ }));
96
+ return nested.flat();
97
+ };
98
+ const keys = await walk('');
99
+ return prefix ? keys.filter((key) => key.startsWith(prefix)) : keys;
89
100
  }
90
101
  /**
91
102
  * Work out the key a save will use, and the URL that key is served under.
@@ -105,7 +116,7 @@ export class LocalFileStore {
105
116
  * Characters that are not safe in a file name are still replaced, exactly as
106
117
  * `getUploadTarget` does it — only the case is left alone.
107
118
  */
108
- resolveTarget(filePath, mimeType, suffixDuplicates) {
119
+ async resolveTarget(filePath, mimeType, suffixDuplicates) {
109
120
  // alphanumerics, dot, underscore, dash and the path separator survive; a
110
121
  // run of anything else becomes one dash. Case is deliberately preserved.
111
122
  //
@@ -124,12 +135,33 @@ export class LocalFileStore {
124
135
  }
125
136
  const ext = sanitisedName.split('.').pop();
126
137
  const withoutExt = sanitisedName.substring(0, sanitisedName.length - (ext.length + 1));
127
- // 6 character random string to avoid clobbering an existing file,
128
- // e.g. report.pdf -> report_312acb.pdf
129
- const randomStringSuffix = suffixDuplicates
130
- ? '_' + Math.random().toString(36).substring(2, 8)
131
- : '';
132
- const storedPath = withoutExt + randomStringSuffix + '.' + ext;
138
+ // A 6 character random string avoids clobbering an existing file,
139
+ // e.g. report.pdf -> report_312acb.pdf.
140
+ //
141
+ // It is only applied when the name is actually taken. This used to be
142
+ // unconditional, which did prevent duplicates but also meant a caller never
143
+ // got back the key it asked for: a content-hashed bundle handed over as
144
+ // `main-hwqwrAvA.css` landed as `main-hwqwrAvA_x9k2ml.css`, so the name
145
+ // baked into the HTML no longer resolved. Checking first keeps the
146
+ // never-clobber guarantee -- a taken name still gets a suffix, and the
147
+ // suffixed name is itself re-checked -- while leaving free names alone.
148
+ // `S3FileStore` has always worked this way, so the two implementations of
149
+ // IFileStore now read the flag the same.
150
+ let storedPath = withoutExt + '.' + ext;
151
+ if (suffixDuplicates) {
152
+ // 36^6 is ~2 billion, so a second collision is already vanishingly
153
+ // unlikely; the cap turns a pathological case into a clear error rather
154
+ // than a spin.
155
+ const maxAttempts = 10;
156
+ let attempt = 0;
157
+ while (await this.fileExists(storedPath)) {
158
+ if (attempt++ >= maxAttempts) {
159
+ throw new Error(`Could not find a free name for '${filePath}' after ${maxAttempts} attempts`);
160
+ }
161
+ storedPath =
162
+ withoutExt + '_' + Math.random().toString(36).substring(2, 8) + '.' + ext;
163
+ }
164
+ }
133
165
  return {
134
166
  storedPath,
135
167
  publicURL: this.accessURL + publicUploadPath + '/' + storedPath,
@@ -160,19 +192,20 @@ export class LocalFileStore {
160
192
  * take. That is what `storedPath` is: hand it straight back to any of them.
161
193
  *
162
194
  * The key equals the `filePath` given verbatim — case included — as long as
163
- * the name needs no sanitising, already has an extension, and
164
- * `preventDuplicates` is `false`. With `preventDuplicates` left unspecified
165
- * (this store's default, kept for upload callers) a random suffix is added,
166
- * and `storedPath` is the only place that name is reported.
195
+ * the name needs no sanitising and already has an extension. With
196
+ * `preventDuplicates` left unspecified (this store's default, kept for upload
197
+ * callers) that still holds for a name nothing else occupies; only a name
198
+ * already taken gains a random suffix, and `storedPath` is the only place
199
+ * that name is reported.
167
200
  */
168
201
  async saveFileWithPath(filePath, fileContent, options, preventDuplicates) {
169
202
  var _a;
170
203
  const normalized = normalizeSaveFileOptions(options, preventDuplicates);
171
204
  // Core reports an unspecified preventDuplicates as undefined, leaving the
172
- // default to each store. This one has always appended a random suffix, so
173
- // only an explicit `false` turns that off.
205
+ // default to each store. This one protects an existing file, so only an
206
+ // explicit `false` allows an overwrite.
174
207
  const suffixDuplicates = (_a = normalized.preventDuplicates) !== null && _a !== void 0 ? _a : true;
175
- const target = this.resolveTarget(filePath, normalized.mimeType, suffixDuplicates);
208
+ const target = await this.resolveTarget(filePath, normalized.mimeType, suffixDuplicates);
176
209
  // resolved against basePath, exactly like every read method does, so what
177
210
  // is written here can be read back by the same key
178
211
  const targetFilePath = path.join(this.basePath, target.storedPath);
@@ -1 +1 @@
1
- {"version":3,"file":"LocalFileStore.js","sourceRoot":"","sources":["../../../../src/shapes/filestores/LocalFileStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAIL,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAiB7B;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IAKzB;;;;OAIG;IACH,YACE,CAA0B,EAC1B,WAAmB,4BAA4B;QAE/C,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,QAAgB;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAExD,OAAO,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,QAAgB;QACzB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEvD,OAAO,EAAE;aACN,MAAM,CAAC,WAAW,CAAC;aACnB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,K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S,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAEhD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEtD,IAAI,IAAkB,CAAC;QACvB,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEnE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACF"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/linked-fw/server.git"
12
12
  },
13
- "version": "2.7.5",
13
+ "version": "2.9.0",
14
14
  "packageManager": "npm@11.19.1",
15
15
  "linkedPackage": true,
16
16
  "type": "module",
@@ -38,8 +38,6 @@
38
38
  "@_linked/cli": "^1.2",
39
39
  "@_linked/core": "^2.20.0",
40
40
  "@_linked/server-utils": "^1.3.0",
41
- "adm-zip": "^0.5.16",
42
- "archiver": "^7.0.1",
43
41
  "autoprefixer": "^10.4.18",
44
42
  "body-parser": "^1.20.2",
45
43
  "chalk": "4.1.2",
@@ -48,10 +46,8 @@
48
46
  "cron": "^4.3.4",
49
47
  "express": "^4.18.3",
50
48
  "fetch-cookie": "^3.1.0",
51
- "is-object": "^1.0.2",
52
49
  "n3": "^1.17.2",
53
50
  "node-addon-api": "^8.2.2",
54
- "node-hook": "^1.0.0",
55
51
  "open": "^8.4.0",
56
52
  "proper-lockfile": "^4.1.2",
57
53
  "react": "^18.2",
@@ -59,14 +55,13 @@
59
55
  "react-error-boundary": "^4.0.13",
60
56
  "react-router-dom": "^6.22.3",
61
57
  "rimraf": "^5.0.5",
62
- "sharp": "^0.34.4",
58
+ "sharp": "^0.35.4",
63
59
  "tough-cookie": "^6.0.0",
64
60
  "tsconfig-to-dual-package": "^1.2.0",
65
61
  "typescript": "^5.7.3",
66
62
  "webpack": "^5.90.3",
67
63
  "webpack-dev-middleware": "^7.0.0",
68
- "webpack-hot-middleware": "^2.26.1",
69
- "zip-a-folder": "^3.1.8"
64
+ "webpack-hot-middleware": "^2.26.1"
70
65
  },
71
66
  "devDependencies": {
72
67
  "@changesets/changelog-github": "^0.5.2",