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

Missed UTF-8 codepoints marshalling in writeStringSlowPath? #216

Open
mnznndr97 opened this issue Dec 15, 2023 · 1 comment
Open

Missed UTF-8 codepoints marshalling in writeStringSlowPath? #216

mnznndr97 opened this issue Dec 15, 2023 · 1 comment
Labels
scope: transformers Anything related to transformers

Comments

@mnznndr97
Copy link

While parsing some fibratus http output, I noticed that in the raw UTF-8 there were some unexpected sequences, for example 0x30 followed by a 0x90.

I never used Go, but if I'm understanding correctly, strings are just like a byte array, and no underlying encoding is enforced.
In writeStringSlowPath(), if a byte that needs to be marshalled to json is > 0x7F, meaning that in UTF8 it's part of a multi-byte sequence, no extra marshalling is applied and it's written directly to the underlying json stream, which uses UTF-8, creating an "invalid" output if, for example, opened with python.

Is this an expected behavior or should these byte values marshalled in other ways?

Here an example of a problematic output: CyberChef - Missed Conversion

@rabbitstack
Copy link
Owner

Hey @mnznndr97 ,

The JSON payload you posted contains the REG_BINARY registry value parameter, which unsurprisingly is a binary blob. Thus, it would require some sort of encoding before transmitting over the wire.

#43 is planning to address this need.

@rabbitstack rabbitstack added the scope: transformers Anything related to transformers label Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: transformers Anything related to transformers
Projects
None yet
Development

No branches or pull requests

2 participants