Skip to content

Conversation

@Hendler
Copy link
Contributor

@Hendler Hendler commented Jan 31, 2026

No description provided.

Hendler and others added 29 commits October 2, 2025 12:21
… permissions

CRITICAL SECURITY FIXES:

1. [CRITICAL] Key derivation now uses PBKDF2-HMAC-SHA256 with 100,000 iterations
   instead of single SHA-256 hash. Previous approach was vulnerable to brute-force.
   - jacs/src/crypt/aes_encrypt.rs: Added derive_key_pbkdf2() with configurable
     iterations, salt generation, and proper key derivation
   - Added MAGIC_HEADER to distinguish new format from legacy encrypted keys
   - Backward compatible: auto-detects and reads legacy format

2. [CRITICAL] Crypto panic handling: Replaced .expect() with .map_err() in
   AES-GCM encrypt/decrypt. Crypto failures now return errors instead of panicking.
   - Prevents potential denial of service from malformed ciphertext

3. [HIGH] Foreign signature verification: verify_wrapped_artifact() now properly
   returns Unverified status for foreign agent signatures when public key is
   unavailable. Previously incorrectly indicated verified.
   - jacs/src/a2a/provenance.rs: Added VerificationStatus enum with Verified,
     SelfSigned, Unverified, Invalid states
   - Added is_verified(), is_invalid(), is_unverified() helper methods

4. [HIGH] Parent signature verification: verify_parent_signatures() now actually
   recursively verifies parent signatures instead of always returning true.

MEDIUM SECURITY FIXES:

5. [MEDIUM] jacsnpm global singleton: Refactored from lazy_static! mutex to
   JacsAgent NAPI class pattern. Multiple agents can now be used concurrently
   in same Node.js process without shared mutable state.
   - jacsnpm/src/lib.rs: Added JacsAgent struct with instance methods
   - Legacy functions preserved with LEGACY_AGENT static for backward compat

6. [MEDIUM] Secure file permissions: Private keys now get 0600 permissions
   (owner read/write only) and key directories get 0700 (owner rwx only) on
   Unix systems. Prevents other users from reading private keys.
   - jacs/src/keystore/mod.rs: Added set_secure_permissions() with Unix/non-Unix
     conditional compilation

OTHER CHANGES:

- Added serial_test crate for test isolation (prevents env var conflicts)
- Regenerated test encrypted key fixtures with correct passwords per config
- Updated CHANGELOG.md with all security fixes under 0.3.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…`lazy_static!` mutex to `JacsAgent` PyO3 class pattern. Multiple agents can now be used concurrently in the same Python process. The `Arc<Mutex<Agent>>` pattern ensures thread-safety and works with Python's GIL as well as future free-threading (Python 3.13+). Legacy functions preserved for backwards compatibility.

+
@Hendler Hendler merged commit 87cfe79 into main Jan 31, 2026
3 checks passed
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.

2 participants