Skip to content

fix: close CodeQL path-injection and integer-overflow alerts - #17

Merged
prashar32 merged 1 commit into
mainfrom
fix/codeql-security-alerts
May 30, 2026
Merged

fix: close CodeQL path-injection and integer-overflow alerts#17
prashar32 merged 1 commit into
mainfrom
fix/codeql-security-alerts

Conversation

@prashar32

Copy link
Copy Markdown
Owner

Closes the 4 high-severity code-scanning (Security & Quality) alerts.

Fixes #10
Fixes #11

Verified: go test -race ./... green; existing traversal + new overflow tests pass. The CodeQL check on this PR should now show those alerts resolved.

Closes the 4 high-severity code-scanning alerts.

- memory Reader (go/path-injection, reader.go): validate the cleaned
  user-supplied path with filepath.IsLocal — rejects absolute paths, "..", and
  any escape, and is recognized as a path-traversal sanitizer — backed by the
  existing within-root prefix check as defense in depth.
- config budget (go/incorrect-integer-conversion, config.go): clamp the parsed
  int64 loop/seconds values to math.MaxInt32 before narrowing to int32, so an
  out-of-range value can't overflow. Adds a regression test.

Fixes #10
Fixes #11
@prashar32
prashar32 merged commit cb299c8 into main May 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant