Skip to content

Feat/fix security robustness#2

Merged
kvasa merged 3 commits intozlepsovanifrom
feat/fix-security-robustness
Mar 15, 2026
Merged

Feat/fix security robustness#2
kvasa merged 3 commits intozlepsovanifrom
feat/fix-security-robustness

Conversation

@kvasa
Copy link
Copy Markdown
Owner

@kvasa kvasa commented Mar 15, 2026

Type of Change

  • Skill - adds a new skill in .claude/skills/
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code

Description

For Skills

  • I have not made any changes to source code
  • My skill contains instructions for Claude to follow (not pre-built code)
  • I tested this skill on a fresh clone

Jarmil and others added 3 commits March 15, 2026 10:39
…itai#8, qwibitai#11 + tests)

Security:
- Fix command injection in stopContainer(): use execFileSync/execFile with
  argument arrays instead of exec() with shell string interpolation.
  Renamed stopContainer() to stopContainerArgs() returning [bin, ...args].

Robustness:
- Fix cursor race condition (index.ts): saveState(chatJid) now does atomic
  read-modify-write of only that group's cursor, preventing cross-group
  cursor clobber when concurrent groups save/rollback simultaneously.
- Cap outgoing message queues in WhatsApp and Slack channels at 1000
  entries to prevent OOM when connection stays down.
- Add double-resolve guard in container-runner Promise (safeResolve()).
- Cache loadSenderAllowlist() result with 5s TTL to avoid synchronous
  file I/O on every incoming message.

Tests:
- mount-security.test.ts: 32 new tests for validateMount, validateAdditionalMounts,
  loadMountAllowlist (previously zero coverage on security-critical module).
- reaction-tracker.test.ts: 11 new tests covering race conditions between
  finalize() and transition timer.
- cursor-isolation.test.ts: 6 regression tests verifying per-group cursor isolation.
- Updated container-runtime.test.ts and sender-allowlist.test.ts for new APIs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract duplicated queue-overflow guard into private enqueue() method
  in both WhatsApp and Slack channels (4 copies → 1 method each)
- Rewrite cursor-isolation tests to exercise the real _saveState() /
  _setLastAgentTimestamp() exports from index.ts instead of reimplementing
  the logic locally, ensuring tests break if saveState() regresses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kvasa kvasa merged commit d6432a3 into zlepsovani Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant