@bom-pi/core 0.2.0 → 0.2.1
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/package.json +1 -1
- package/src/pairing-storage.ts +6 -1
package/package.json
CHANGED
package/src/pairing-storage.ts
CHANGED
|
@@ -83,7 +83,12 @@ function parse(text: string, limit: number): StorageSnapshot {
|
|
|
83
83
|
async function checkDirectory(directory: string): Promise<void> {
|
|
84
84
|
const stat = await lstat(directory);
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
// POSIX-only privacy proof: Windows has no POSIX mode bits (Node reports 0666 for every
|
|
87
|
+
// directory), so on win32 the check is the user-profile directory's own ACL and the mode
|
|
88
|
+
// assertion is skipped — same ADR-13 §4 spirit as the endpoint's platform gate.
|
|
89
|
+
const modeOk = process.platform === "win32" || (stat.mode & 0o777) === 0o700;
|
|
90
|
+
|
|
91
|
+
if (!stat.isDirectory() || !modeOk) {
|
|
87
92
|
fail("directory must be private (0700) and not a symlink");
|
|
88
93
|
}
|
|
89
94
|
}
|