Skip to content

fix(security): 2 improvements across 2 files#6226

Open
tomaioo wants to merge 2 commits into
elastic:mainfrom
tomaioo:fix/security/type-generation-errors-are-logged-but-no
Open

fix(security): 2 improvements across 2 files#6226
tomaioo wants to merge 2 commits into
elastic:mainfrom
tomaioo:fix/security/type-generation-errors-are-logged-but-no

Conversation

@tomaioo

@tomaioo tomaioo commented Apr 21, 2026

Copy link
Copy Markdown

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: Medium | File: compiler-rs/openapi_to_clients_schema/src/lib.rs:L40

During OpenAPI-to-clients-schema conversion, failures in individual type generation are only logged with warn! and processing continues. Additionally, types.check_tracker() is called but its result is explicitly ignored (// TODO: actually fail). This can produce partially generated or inconsistent schemas without failing the build, which can weaken downstream validation and allow malformed API contracts to be published unnoticed.

Solution

Fail closed on conversion inconsistencies: accumulate generation errors and return an Err when any type fails, and enforce check_tracker() results instead of ignoring them. Optionally provide a strict mode defaulting to hard-fail in CI.

Changes

  • compiler-rs/openapi_to_clients_schema/src/lib.rs (modified)
  • compiler/src/transform/schema-to-openapi.ts (modified)

tomaioo added 2 commits April 20, 2026 23:12
- Security: Type generation errors are logged but not enforced, allowing silent schema corruption
- Security: Conversion CLI wrappers swallow exceptions and may exit successfully on failure

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Type generation errors are logged but not enforced, allowing silent schema corruption
- Security: Conversion CLI wrappers swallow exceptions and may exit successfully on failure

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo
tomaioo requested a review from a team as a code owner April 21, 2026 06:12
@cla-checker-service

Copy link
Copy Markdown

❌ Author of the following commits did not sign a Contributor Agreement:
662b0fd, eed82a5

Please, read and sign the above mentioned agreement if you want to contribute to this project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant