Skip to content

Commit

Permalink
fix: check len of input (#2671)
Browse files Browse the repository at this point in the history
Fixes #2628
  • Loading branch information
alecthomas authored Sep 13, 2024
1 parent ca2bde0 commit c16b0d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/configuration/obfuscator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (o Obfuscator) Obfuscate(input []byte) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("could not create cypher for obfuscation: %w", err)
}
if len(input) > 64*1024*1024 {
return nil, errors.New("value too large")
}
ciphertext := make([]byte, aes.BlockSize+len(input))
iv := ciphertext[:aes.BlockSize]
if _, err := io.ReadFull(rand.Reader, iv); err != nil {
Expand Down

0 comments on commit c16b0d6

Please sign in to comment.