Parsing a cron expression with an excessively long list of repeated wildcards or values in any field causes the parser to hang or consume excessive memory before rejecting the expression.
Parsing a cron expression with an excessively long list of repeated wildcards or values in any field causes the parser to hang or consume excessive memory before rejecting the expression.
CronExpressionParser from cron-parser (or your application's schedule module).'*,'.repeat(100000) + '* * * * * *'.CronExpressionParser.parse(expression).The parser should quickly reject the expression with a constraint error indicating that the field contains too many values.
The parser expands every atom of the list before checking constraints, leading to excessive memory consumption or hanging.
This issue typically surfaces when automated tooling or user-generated schedules feed unvalidated or maliciously constructed cron strings into the scheduler parser. Restricting field value expansion at parse time prevents resource exhaustion.
Adapted from harrisiirak/cron-parser (MIT).
Visible test command
npm test -- --testPathPattern=visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
bound-field-value-expansion
Changes under src/ are evaluated.