Skip to content

Harden CEL type signature parsing and env type resolution - #2508

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1035895361
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1035895361

Conversation

@copybara-service

Copy link
Copy Markdown

Harden CEL type signature parsing and env type resolution

  • Require optional_type to have exactly 1 type parameter in
    ParseTypeSignature, TypeInfoToType, and TypeInfoToTypeSpec.
  • Bound recursion depth in ParseTypeSignature (kMaxTypeSignatureDepth = 128).
  • Enforce iterative type node-count (kMaxTypeNodeCount = 1000) and nesting
    depth (CheckerOptions::max_type_decl_nesting) limits in cel::Env before
    recursive type resolution.
  • Require registered opaque type parameters to be type parameters
    (TypeKind::kTypeParam) and validate that repeated type parameters are bound
    consistently without allocating arenas inside recursive stack frames.

- Require `optional_type` to have exactly 1 type parameter in
  `ParseTypeSignature`, `TypeInfoToType`, and `TypeInfoToTypeSpec`.
- Bound recursion depth in `ParseTypeSignature` (`kMaxTypeSignatureDepth = 128`).
- Enforce iterative type node-count (`kMaxTypeNodeCount = 1000`) and nesting
  depth (`CheckerOptions::max_type_decl_nesting`) limits in `cel::Env` before
  recursive type resolution.
- Require registered opaque type parameters to be type parameters
  (`TypeKind::kTypeParam`) and validate that repeated type parameters are bound
  consistently without allocating arenas inside recursive stack frames.

PiperOrigin-RevId: 1035895361
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.

1 participant