Skip to content

L-5: JSON.parse Without try-catch in gRPC Service AdapterConfig Handling

Low
nick-pape published GHSA-8g29-8xwr-qmhr Mar 22, 2026

Package

npm @grackle-ai/server (npm)

Affected versions

<= 0.70.5

Patched versions

0.70.6

Description

Impact

JSON.parse(env.adapterConfig) is called without error handling in three locations within the gRPC service. While the data originates from the server's own SQLite database and should always be valid JSON, database corruption, migration errors, or unexpected state could cause an unhandled exception that crashes the gRPC handler.

Additionally, the parsed result is cast as Record<string, unknown> and passed to adapter methods without property validation, creating a theoretical prototype pollution surface if the database is compromised.

Affected code:

  • packages/server/src/grpc-service.ts:415reconnectOrProvision handler
  • packages/server/src/grpc-service.ts:482stopEnvironment handler
  • packages/server/src/grpc-service.ts:498destroyEnvironment handler

Patches

Not yet patched.

Fix: Wrap in try-catch and return a meaningful gRPC error:

let config: Record<string, unknown>;
try {
  config = JSON.parse(env.adapterConfig) as Record<string, unknown>;
} catch {
  throw new ConnectError("Invalid adapter configuration", Code.Internal);
}

Workarounds

Ensure database integrity. Back up the SQLite database regularly.

References

  • CWE-754: Improper Check for Unusual or Exceptional Conditions
  • File: packages/server/src/grpc-service.ts

Severity

Low

CVE ID

No known CVE

Weaknesses

No CWEs