Skip to content
vetkitChecksChangelogDocumentation

vetkit.go.integer.truncating-conversion

A number parsed from a string as a full-width integer is converted to a narrower type without a range check. Out-of-range input silently wraps around, which can bypass size or bounds checks.

Last updated:

Suite: Security

go

A number parsed from a string as a full-width integer is converted to a narrower type without a range check. Out-of-range input silently wraps around, which can bypass size or bounds checks.

Category: SECURITY · Engine rule severity: INFO

How to fix it

Parse with the target width (strconv.ParseInt(s, 10, 32)) or compare against math.MaxInt32 / math.MaxUint16 before converting.

References

Source: packages/engine/rules/sast/go.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.