Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
This repository was archived by the owner on May 24, 2026. It is now read-only.

security: cron schedule strings are written to crontab without format validation #18

Open

Description

@SimplicityGuy

Summary

The schedule field from config files is written directly to the crontab file without validating that it matches valid cron syntax. While the impact is limited (invalid schedules cause cron parse errors rather than injection), a crafted value could potentially affect crontab parsing or inject comment/newline characters.

Location

entrypoint.sh lines 161–166

SCHEDULE=$(echo "${KEY}" | jq -r '.schedule' | sed 's/\*/\\*/g')
if [ "${SCHEDULE}" == "null" ]; then
    echo "'schedule' missing: '${KEY}"
    continue
fi
SCHEDULE=$(parse_schedule "${SCHEDULE}" | sed 's/\\//g')

Risk

  • Newline injection into the crontab file could insert unauthorized cron entries
  • Invalid cron syntax silently breaks job scheduling

Recommended Fix

Validate the schedule string before writing it. At minimum, strip or reject newline characters:

# Reject newlines and other dangerous characters
if echo "${SCHEDULE}" | grep -qP '[\\n\\r]'; then
    echo "Error: invalid schedule value"
    continue
fi

For stronger validation, check against the expected cron field pattern before writing.

Severity

Medium

Activity

  1. added
    security
    on Feb 28, 2026
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

    security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions