GeezerVison is showing github.com — Merge #1273's branch (with main) into the envelope integration branch · SocketDev/socket-patch@603b03b
File treeExpand file treeCollapse file tree Open diff view settings crates/socket-patch-cli/tests
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_hosted_production.rs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 33 | 33 | //! | 34 | 34 | //! | Ecosystem | PURL | Patch UUID | Advisory | | 35 | 35 | //! |-----------|------|------------|----------| | 36 | | -//! | npm | `pkg:npm/[email protected]` | `80630680-4da6-45f9-bba8-b888e0ffd58c` | GHSA-xvch-5gv4-984h (CVE-2021-44906) | | | 36 | +//! | npm | `pkg:npm/[email protected]` | `642d7f02-ebc1-4ab0-99e2-07f5dd8463cb` | GHSA-xvch-5gv4-984h (CVE-2021-44906) | | 37 | 37 | //! | PyPI | `pkg:pypi/[email protected]` | *any of three* (see [`PYPI_UUIDS`]) | GHSA-gm62-xv2j-4w53 &co | | 38 | 38 | //! | gem | `pkg:gem/[email protected]` | *any of* [`GEM_UUIDS`] (six today; the sixth merges three advisories) | GHSA-m42x-37p3-fv5w (CVE-2020-8162), GHSA-w749-p3v6-hccq (CVE-2022-21831), GHSA-9xrj-h377-fr87 (CVE-2026-33195), GHSA-r4mg-4433-c7g3 (CVE-2025-24293), GHSA-xr9x-r78c-5hrm (CVE-2026-66066) | | 39 | 39 | //! | @@ -126,7 +126,7 @@ const PATCH_HOST: &str = "patch.socket.dev"; | 126 | 126 | | 127 | 127 | const NPM_NAME: &str = "minimist"; | 128 | 128 | const NPM_VERSION: &str = "1.2.2"; | 129 | | -const NPM_UUID: &str = "80630680-4da6-45f9-bba8-b888e0ffd58c"; | | 129 | +const NPM_UUID: &str = "642d7f02-ebc1-4ab0-99e2-07f5dd8463cb"; | 130 | 130 |
| 131 | 131 | | 132 | 132 | const PYPI_NAME: &str = "urllib3"; | |
Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_npm.rs +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | //! End-to-end tests for the npm patch lifecycle. | 2 | 2 | //! | 3 | 3 | //! These tests exercise the full CLI against the real Socket API, using the | 4 | | - | | 4 | + | 5 | 5 | //! which fixes CVE-2021-44906 (Prototype Pollution). | 6 | 6 | //! | 7 | 7 | //! # Prerequisites | @@ -26,14 +26,14 @@ use common::cache_env; | 26 | 26 | // Constants | 27 | 27 | // --------------------------------------------------------------------------- | 28 | 28 |
| 29 | | -const NPM_UUID: &str = "80630680-4da6-45f9-bba8-b888e0ffd58c"; | | 29 | +const NPM_UUID: &str = "642d7f02-ebc1-4ab0-99e2-07f5dd8463cb"; | 30 | 30 | | 31 | 31 |
| 32 | 32 | /// Git SHA-256 of the *unpatched* `index.js` shipped with minimist 1.2.2. | 33 | 33 | const BEFORE_HASH: &str = "311f1e893e6eac502693fad8617dcf5353a043ccc0f7b4ba9fe385e838b67a10"; | 34 | 34 |
| 35 | 35 | /// Git SHA-256 of the *patched* `index.js` after the security fix. | 36 | | -const AFTER_HASH: &str = "043f04d19e884aa5f8371428718d2a3f27a0d231afe77a2620ac6312f80aaa28"; | | 36 | +const AFTER_HASH: &str = "ec956dcafb886f14315570bf3981d44aa12c561716abb46eed8b067aaa1f6bdf"; | 37 | 37 |
| 38 | 38 | // --------------------------------------------------------------------------- | 39 | 39 | // Helpers | |
Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_safety_pnpm.rs +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 | //! view and the store entry byte-identical. | 12 | 12 | //! | 13 | 13 | | 14 | | -//! `80630680-4da6-45f9-bba8-b888e0ffd58c`, CVE-2021-44906) — same | | 14 | +//! `642d7f02-ebc1-4ab0-99e2-07f5dd8463cb`, CVE-2021-44906) — same | 15 | 15 | //! pair `e2e_npm.rs` uses, so the BEFORE/AFTER hashes are known. | 16 | 16 | //! | 17 | 17 | //! Network: yes (pnpm install + socket-patch get). Toolchain: pnpm. | @@ -24,12 +24,12 @@ mod common; | 24 | 24 |
| 25 | 25 | use common::{assert_run_ok, git_sha256_file, has_command, pnpm_run, write_package_json}; | 26 | 26 |
| 27 | | -const NPM_UUID: &str = "80630680-4da6-45f9-bba8-b888e0ffd58c"; | | 27 | +const NPM_UUID: &str = "642d7f02-ebc1-4ab0-99e2-07f5dd8463cb"; | 28 | 28 |
| 29 | 29 | /// Git-SHA-256 of the *unpatched* `index.js` shipped with minimist 1.2.2. | 30 | 30 | const BEFORE_HASH: &str = "311f1e893e6eac502693fad8617dcf5353a043ccc0f7b4ba9fe385e838b67a10"; | 31 | 31 | /// Git-SHA-256 of the *patched* `index.js` after the security fix. | 32 | | -const AFTER_HASH: &str = "043f04d19e884aa5f8371428718d2a3f27a0d231afe77a2620ac6312f80aaa28"; | | 32 | +const AFTER_HASH: &str = "ec956dcafb886f14315570bf3981d44aa12c561716abb46eed8b067aaa1f6bdf"; | 33 | 33 |
| 34 | 34 | // ── Setup helpers ───────────────────────────────────────────────────── | 35 | 35 |
| |
Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_vendored_production.rs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 49 | 49 | //! | 50 | 50 | //! | Ecosystem | PURL | Patch UUID | Marker in the patched bytes | | 51 | 51 | //! |-----------|------|------------|-----------------------------| | 52 | | -//! | npm | `pkg:npm/[email protected]` | `80630680-4da6-45f9-bba8-b888e0ffd58c` | `Socket Community Patch` header | | | 52 | +//! | npm | `pkg:npm/[email protected]` | `642d7f02-ebc1-4ab0-99e2-07f5dd8463cb` | `Socket Community Patch` header | | 53 | 53 | //! | PyPI | `pkg:pypi/[email protected]` | *any of three* (see [`PYPI_UUIDS`]) | `Socket Community Patch` header | | 54 | 54 | //! | gem | `pkg:gem/[email protected]` | *any of* [`GEM_PATCHES`] | `Socket Community Patch` header | | 55 | 55 | //! | @@ -137,7 +137,7 @@ const PROXY: &str = "https://patches-api.socket.dev"; | 137 | 137 | | 138 | 138 | const NPM_NAME: &str = "minimist"; | 139 | 139 | const NPM_VERSION: &str = "1.2.2"; | 140 | | -const NPM_UUID: &str = "80630680-4da6-45f9-bba8-b888e0ffd58c"; | | 140 | +const NPM_UUID: &str = "642d7f02-ebc1-4ab0-99e2-07f5dd8463cb"; | 141 | 141 |
| 142 | 142 | | 143 | 143 | const PYPI_NAME: &str = "urllib3"; | |
Collapse file Copy file name to clipboardExpand all lines: docs/testing/bun-compatibility.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ projects using text `bun.lock` or native binary `bun.lockb`. Real-Bun evidence b | 5 | 5 |
| 6 | 6 | - **The native matrix** — `scripts/backtest-bun.py` runs real Bun releases | 7 | 7 | | 8 | | - (`80630680-4da6-45f9-bba8-b888e0ffd58c`) with the production CLI and patch | | 8 | + (`642d7f02-ebc1-4ab0-99e2-07f5dd8463cb`) with the production CLI and patch | 9 | 9 | service, without a token or substitute service, and checks the INSTALLED | 10 | 10 | bytes, lock stability, digest rejection and rollback on Linux, macOS and | 11 | 11 | Windows ([workflow](../../.github/workflows/bun-compatibility.yml)). | |
Collapse file Copy file name to clipboardExpand all lines: scripts/backtest-bun.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 117 | 117 | # former `vendored-detached` leg collapsed into `vendored`: same footprint. | 118 | 118 | MODES = ['hosted', 'vendored'] | 119 | 119 | | 120 | | -UUID = '80630680-4da6-45f9-bba8-b888e0ffd58c' | | 120 | +UUID = '642d7f02-ebc1-4ab0-99e2-07f5dd8463cb' | 121 | 121 | # The registry slot bun writes for a non-default registry: the full tarball URL. | 122 | 122 | REGISTRY_SLOT = 'https://registry.npmjs.org/minimist/-/minimist-1.2.2.tgz' | 123 | 123 | | |
Collapse file Copy file name to clipboardExpand all lines: scripts/backtest-vlt.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 88 | 88 | VERSIONS = ['0.0.0-16', '0.0.0-32', '1.0.0-rc.14', '1.0.0-rc.32', '1.0.4', '1.0.10', '1.2.0'] | 89 | 89 | MODES = ['hosted', 'vendored', 'agent'] | 90 | 90 | | 91 | | -UUID = '80630680-4da6-45f9-bba8-b888e0ffd58c' | | 91 | +UUID = '642d7f02-ebc1-4ab0-99e2-07f5dd8463cb' | 92 | 92 | NAME = 'minimist' | 93 | 93 | VERSION = '1.2.2' | 94 | 94 | TARGET = f'{NAME}@{VERSION}' | @@ -1069,7 +1069,7 @@ def holds(self, root, lock_text, side): | 1069 | 1069 | ok = True | 1070 | 1070 | for copy_dir in self.copies(root, lock_text): | 1071 | 1071 | for key, hashes in self.record['files'].items(): | 1072 | | - path = copy_dir / key.split('/', 1)[1] | | 1072 | + path = copy_dir / key.removeprefix('package/') | 1073 | 1073 | digest = git_hash(path.read_bytes()) if path.is_file() else None | 1074 | 1074 | details[str(path.relative_to(root))] = digest | 1075 | 1075 | ok = ok and digest == hashes.get(f'{side}Hash') | |
Collapse file Copy file name to clipboardExpand all lines: scripts/tests/test_backtest_harnesses.py +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -814,6 +814,39 @@ def test_shapes_are_depscan_capture_shapes(self): | 814 | 814 | self.assertLessEqual(set(vlt.SHAPES), capture_names) | 815 | 815 |
| 816 | 816 |
| | 817 | +class VltInstalledBytesTests(unittest.TestCase): | | 818 | + def test_holds_checks_root_and_nested_files_with_optional_package_prefix(self): | | 819 | + contents = { | | 820 | + 'index.js': {'before': b'original entrypoint', 'after': b'patched entrypoint'}, | | 821 | + 'test/proto.js': {'before': b'original test', 'after': b'patched test'}, | | 822 | + } | | 823 | + for prefix in ('', 'package/'): | | 824 | + for side in ('before', 'after'): | | 825 | + with self.subTest(prefix=prefix, side=side), tempfile.TemporaryDirectory() as temp: | | 826 | + root = Path(temp) | | 827 | + package = root / 'node_modules' / 'minimist' | | 828 | + record = {'files': { | | 829 | + prefix + name: {s + 'Hash': vlt.git_hash(data) for s, data in sides.items()} | | 830 | + for name, sides in contents.items() | | 831 | + }} | | 832 | + cell = vlt.Cell({'out': root, 'record': record}, '1.2.0', 'vendored', 'direct') | | 833 | + expected = {} | | 834 | + for name, sides in contents.items(): | | 835 | + path = package / name | | 836 | + path.parent.mkdir(parents=True, exist_ok=True) | | 837 | + path.write_bytes(sides[side]) | | 838 | + expected[str(path.relative_to(root))] = vlt.git_hash(sides[side]) | | 839 | + self.assertEqual(cell.holds(root, '{}', side), (True, expected)) | | 840 | + other_side = 'after' if side == 'before' else 'before' | | 841 | + self.assertFalse(cell.holds(root, '{}', other_side)[0]) | | 842 | + | | 843 | + nested = package / 'test' / 'proto.js' | | 844 | + nested.write_bytes(b'corrupted') | | 845 | + self.assertFalse(cell.holds(root, '{}', side)[0]) | | 846 | + nested.unlink() | | 847 | + self.assertFalse(cell.holds(root, '{}', side)[0]) | | 848 | + | | 849 | + | 817 | 850 | class VltConfigTests(unittest.TestCase): | 818 | 851 | """write_vlt_json follows the DESIGN §8.3 per-era registry table.""" | 819 | 852 |
| |
|