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

TCF Decoding Issues #399

Open
zbartholomew opened this issue Feb 7, 2025 · 4 comments
Open

TCF Decoding Issues #399

zbartholomew opened this issue Feb 7, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@zbartholomew
Copy link

zbartholomew commented Feb 7, 2025

The example TCFv2 string in the documentation fails on most non IAB online decoders

COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw

However it "works" on the IAB decoder...BUT if you encode the decoded JSON you get a different string back.

COw12UAOw12UAAAAAAENAXCAAAAAAAAAAAAAAAAAAAAA.QFukWSAgAIQwgIUQEASFAAAAeIAACAIAQAAQAIAgEQACEABAAAgAQFAEAIAAAGBAAgAAAAQAIFAAECQAAAAAQiRAEQAAAAANAAIAAgAAAYQFAAARmggBCWQCYxUgyIAA.IFukWSAgAIQwgIUQEASFAAAAeIAACAIAQAAQAIAgEQACEABAAAgAQFAEAIAAAGBAAgAAAAQAIFAAECQAAAAAQiRAEQAAAAANAAIAAgAAAYQFAAARmggBCWQCYxUgyIAA

I've noticed that we have been receiving similar TCFv2 strings that will be decoded without error using the IAB GPP/TCFv2 decoders, but encoding them again returns a different string. Using our decoders built off the spec usually returns.

Another example using the https://www.uniconsent.com/tcf-decoder decoder with the other example string provided in the docs

COw4XqLOw4XqLAAAAAENAXCAAAAAAAAAAAAAAAAAAAAA.IFukWSQgAIQwgI0QEByFAAAAeIAACAIgSAAQAIAgEQACEABAAAgAQFAEAIAAAGBAAgAAAAQAIFAAMCQAAgAAQiRAEQAAAAANAAIAAggAIYQFAAARmggBC3ZCYzU2yIA.QFukWSQgAIQwgI0QEByFAAAAeIAACAIgSAAQAIAgEQACEABAAAgAQFAEAIAAAGBAAgAAAAQAIFAAMCQAAgAAQiRAEQAAAAANAAIAAggAIYQFAAARmggBC3ZCYzU2yIA.YAAAAAAAAAAAAAAAAAA

fails with

Danger
Decode failed with the following error:
invalid value 0 passed for cmpId

Am I missing something in the docs that could explain this?

@HeinzBaumann
Copy link
Collaborator

@zbartholomew Thank you for reporting this. It looks like we never update the actual TC string examples in the specification. We will need to this to correct the issues you listed.

@HeinzBaumann HeinzBaumann added the bug Something isn't working label Feb 10, 2025
@HeinzBaumann HeinzBaumann self-assigned this Feb 10, 2025
@janwinkler
Copy link

@zbartholomew please note that strings can be encoded in multiple ways, e.g. the vendor consent section can be range or bitfield.

Without having a deeper look at the string itself you can already tell from decoding of the first string (COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw) that something is wrong:

  • the string is from Feb 2020?
  • policy version is 2, the string should have been updated
  • string is not service specific (=global scope) which was removed in 2021

@janwinkler
Copy link

PS: the encoded string you sent also seems wrong: the second segment should never start with a Q

@zbartholomew
Copy link
Author

These strings are directly from the IAB docs. The note about the second string bring wrong indicates the online encoder is incorrect since that is how that string was created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants