airvzxf / airvzxf/ftp-deployment-action

fix(validate_int): accepts absurdly large values; add an upper bound

Open
#180 1 comment 0 reactions 0 assignees View on GitHub
audit bug pending-design pending-human priority:medium
Dominant language
Shell
Stars
37
Forks
9
Avg merge
44m
Merged PRs (30d)
47

Description

gh issue create --title "fix(validate_int): accepts absurdly large values; add an upper bound" --label "bug,audit,priority:medium" --body "## Finding

validate_int accepts any non-negative integer without an upper bound. A user-supplied value of 2^63 - 1 for INPUT_MAX_RETRIES (or any numeric input) silently propagates and produces a retry loop the action cannot realistically complete. Some numeric inputs have an obvious upper bound (mirror_verbose: 0-3, max_retries: practical 10) and should reject the rest.

## Affected code

- lib.sh — validate_int (function)

## Reproduction

1. Set INPUT_MAX_RETRIES to 999999999999.
2. The action accepts it; the retry loop runs until the GitHub Actions job timeout (or, if input is too large, an integer overflow somewhere downstream).

## Suggested fix

Either add per-input upper bounds at the call site in entrypoint.sh (preferred — keeps validate_int generic), or accept an optional 3rd arg to validate_int that is the upper bound and call sites pass one.

## Source

F2 audit 2026-09-03 (lib.sh audit). Reporter: subagent-pekodbj7.

## Related

- Part of EPIC #[epic-number]
- Closes: #NONE (no existing issue)
- Related: LOW-3 (leading zeros)"

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lib.sh at validate_int, then inspect its call sites in entrypoint.sh. Reproduce the issue with INPUT_MAX_RETRIES set to 999999999999 and determine the existing validation flow for numeric inputs. Done means absurdly large values are rejected while validate_int remains generic or its optional upper-bound behavior is consistently applied at the call sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.