#17·sdk-js

Code Audit: 3 potential issue(s) found

Author: asmit25805Created Jun 15, 2026Updated Jun 15, 2026

Code Audit Report

All findings are reviewed for confidence before posting. Please verify each finding before acting on it.

Repository: unicity-astrid/sdk-js Findings: 3 issue(s) found — 1 medium · 2 low


1. Potential for JSON Injection

Field Details
Severity Medium
Type Security
File packages/astrid-sdk/src/approval.ts
Location requestDecision function
Confidence 90%

Problem: The JSON.stringify(action) call could potentially lead to a JSON injection vulnerability if the action parameter is not properly sanitized. This could allow an attacker to inject malicious JSON data.

Suggested Fix: Use a safer method to serialize the action parameter, such as using a dedicated JSON serialization library that can handle untrusted input.


2. Lack of Error Handling

Field Details
Severity Low
Type Bug
File packages/astrid-sdk/src/approval.ts
Location request function
Confidence 85%

Problem: The request function does not handle any potential errors that may occur during the approval request process. This could lead to unexpected behavior or crashes if an error occurs.

Suggested Fix: Add try-catch blocks to handle any potential errors that may occur during the approval request process.


3. ⚡ Potential for Timeout Issues

Field Details
Severity Low
Type Performance
File packages/astrid-sdk/src/approval.ts
Location requestDecision function
Confidence 80%

Problem: The requestDecision function blocks until the user responds or the request times out (60s). This could potentially lead to performance issues if the timeout is not properly handled.

Suggested Fix: Consider using a non-blocking approach or implementing a more robust timeout handling mechanism to prevent performance issues.


About this report

This report was generated using Llama 3.3 70B. Only findings with ≥80% confidence are included. False positives are possible — use your own judgment.