fix(mesh): reject a manifest step that is not a string

decode is the mesh's trust boundary, reached before the handshake
authenticates the peer. The manifest row checked that steps was an array
but not what was in it, so {"steps":[123]} decoded cleanly and 123 would
have become a graph node name in buildRemote.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-09-12 15:40:24 -05:00
1 parent 6e66b05a41
commit 414b188792
2 files changed
+9

No files matched your search

+6
View File
@@ -32,6 +32,12 @@ describe('protocol codec', () => {
);
});
it('rejects a manifest whose steps array contains a non-string element', () => {
expect(() => decode(JSON.stringify({ type: 'manifest', v: V, steps: [123], routes: [] }))).toThrow(
/every step must be a string/,
);
});
it('throws on malformed json', () => {
expect(() => decode('{not json')).toThrow();
});