Skip to content

Commit

Permalink
fix: Limit maximum BER packet length in FuzzParseDN to 65536 bytes (g…
Browse files Browse the repository at this point in the history
…o-ldap#466)

Parallel and large amount of fuzzing data can create large amounts of allocated data and cause restricted fuzzing environments to crash (see go-ldap#460)
  • Loading branch information
cpuschma authored and gustavoluvizotto committed Apr 11, 2024
1 parent 87ffed5 commit 169c1c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

package ldap

import "testing"
import (
ber "github.com/go-asn1-ber/asn1-ber"
"testing"
)

func FuzzParseDN(f *testing.F) {
// See https://github.com/go-asn1-ber/asn1-ber/blob/04301b4b1c5ff66221f8f8a394f814a9917d678a/fuzz_test.go#L33-L37
// for why this limitation is necessary
ber.MaxPacketLengthBytes = 65536

f.Add("*")
f.Add("cn=Jim\\0Test")
Expand Down

0 comments on commit 169c1c9

Please sign in to comment.