Skip to content

Crash in cron.ParseStandard #470

Open

Description

@secsys-go

Crash

panic: runtime error: slice bounds out of range [:-1]

Crash Log

github.com/robfig/cron/v3.Parser.Parse({0x125d130}, {0x116435c, 0x9})
/Users/ljc/go/pkg/mod/github.com/robfig/cron/[email protected]/parser.go:99 +0x7bc
github.com/robfig/cron/v3.ParseStandard(...)
/Users/ljc/go/pkg/mod/github.com/robfig/cron/[email protected]/parser.go:230

PoC

cron.ParseStandard("TZ=TZ=TZ=")

Activity

  1. Placebo900 commented on Oct 9, 2023

    @Placebo900

    @robfig hey, my fuzzer encountered this problem, the solution seems to be simple. Now Parse panics when the time zone is entered incorrectly, like what is written here in the issue, so I just processed the input. Can you please take a look at my pr?

  2. tooptoop4 commented on Oct 9, 2023

    @tooptoop4

    @Placebo900 robfig dipped out years ago so this is abandonware

  3. fitzyracing1 commented on Oct 8, 2026

    @fitzyracing1

    This is fixed in github.com/fitzyracing1/cron/v3 v3.0.2 (v3.0.1 plus this fix only, same API): cron.ParseStandard("TZ=TZ=TZ=") and other specs that are only a TZ=/CRON_TZ= prefix now return an error instead of panicking with slice bounds out of range [:-1]. There's also a fuzz test over all parsers. Drop-in via go.mod: replace github.com/robfig/cron/v3 => github.com/fitzyracing1/cron/v3 v3.0.2. Details: https://github.com/fitzyracing1/cron

  4. added 2 commits that reference this issue on Nov 2, 2026
    a6fb397
    15e96ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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