Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

test(agentbbs): regression test for roomId path traversal (follow-up to #4416) (#4420)

rUvbcaf73703279
diff --git a/v3/@claude-flow/cli/__tests__/agentbbs-tools.test.ts b/v3/@claude-flow/cli/__tests__/agentbbs-tools.test.ts
index bb7a0fb0f2..bb563e1309 100644
--- a/v3/@claude-flow/cli/__tests__/agentbbs-tools.test.ts
+++ b/v3/@claude-flow/cli/__tests__/agentbbs-tools.test.ts
@@ -99,6 +99,15 @@ describe('agentbbs MCP tools — structural contract', () => {
expect(/^[A-Za-z0-9_.\-:/@#]+$/.test('hr/onboarding')).toBe(true);
});
+ it('publish and watch reject a roomId that escapes the .agentbbs dir (..)', async () => {
+ const publish = findTool('federation_bbs_publish');
+ const watch = findTool('federation_bbs_watch');
+ for (const roomId of ['../../../../tmp/x', 'a/../../../tmp/x', '..']) {
+ await expect(publish.handler({ roomId, msgType: 'task-result', payload: {} })).rejects.toThrow(/must not contain \.\./);
+ await expect(watch.handler({ roomId })).rejects.toThrow(/must not contain \.\./);
+ }
+ });
+
it('publish rejects malformed msgType (validation runs before optional-dep check)', async () => {
const publish = findTool('federation_bbs_publish');
await expect(publish.handler({