Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go support for GDPR v1.12.0 crashes with Go Fuzz test #358

Closed
ntframeplay opened this issue Jan 9, 2024 · 3 comments
Closed

Go support for GDPR v1.12.0 crashes with Go Fuzz test #358

ntframeplay opened this issue Jan 9, 2024 · 3 comments

Comments

@ntframeplay
Copy link

Using the fuzz test string below (or similar)

go test fuzz v1
string("C0000000000000000000000000000000000AAdA000000000000")

the following crash & stack trace occurs:

image

Fuzz test func:

func FuzzTCF(f *testing.F) {
	// Only one function to be tested
	f.Fuzz(func(t *testing.T, tcfStr string) {
		_, _ = tcf(tcfStr)
	})
}

and tcf func

func tcf(tcf_str string) (tcfData, error) {
	if len(tcf_str) == 0 {
		return tcfData{}, nil
	}
	consent, err := vendorconsent.ParseString(tcf_str) // string is base64 encoded
	if err != nil {
		return tcfData{}, err
	}

	return tcfData{
		tcf_str,
		consent.VendorListVersion(),
		consent.VendorConsent(uint16(TCFFramePlayVendorID)),
		consent.PurposeAllowed(3),
	}, nil
}

index out of range occurs in return value of
/go-gdpr/vendorconsent/tcf2.isSet(...)

@HeinzBaumann
Copy link
Collaborator

@ntframeplay IAB doesn't support a GO library. Please raise this issue against the respective GO library that you are using. Thanks

@ntframeplay
Copy link
Author

thanks, moved to proper lib prebid/go-gdpr#40 (comment)

@HeinzBaumann
Copy link
Collaborator

Closed. Issues is tracked here: prebid/go-gdpr#40 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants