Skip to content

[Security] Bot API bindings generated from unpinned upstream spec — supply chain compromise risk #35

@vangelif

Description

@vangelif

Severity: High
Metric: Supply Chain Risk — Current: 7/10 → After Fix: 2/10 | 71% risk reduction
File: codegen scripts (ts-morph@27.0.2 consuming @grom.js/bot-api-spec)

Issue

Bot API bindings are generated via ts-morph from @grom.js/bot-api-spec. If this package uses a range specifier (^ or ~) rather than an exact version pin, a compromised or accidentally broken publish of the spec automatically propagates into generated bindings the next time codegen runs — affecting all downstream library consumers.

Suggested fix

  1. Pin @grom.js/bot-api-spec to an exact version (no ^ or ~).
  2. Commit a SHA-256 hash of the expected generated output:
sha256sum src/generated/bot-api.ts > codegen/output.sha256
  1. Fail CI if the hash changes unexpectedly:
sha256sum --check codegen/output.sha256
  1. Add CODEOWNERS rule requiring maintainer review on any change to generated files.

This issue was identified by agentic audit tool. If this doesn't apply to your project, feel free to close it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions