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

EXI Header check is too lax #102

Closed
barsnick opened this issue Dec 10, 2024 · 0 comments · Fixed by #103
Closed

EXI Header check is too lax #102

barsnick opened this issue Dec 10, 2024 · 0 comments · Fixed by #103
Assignees
Labels
bug Something isn't working

Comments

@barsnick
Copy link
Contributor

barsnick commented Dec 10, 2024

Describe the bug

EXI streams beginning with some values other than 0x80, such as 0x01 or 0x40, should not be decoded.

To Reproduce

See the example streams provided here: #99
4084400009690002000000000000000000000000000000000000000000000000008000009c009c9c39393039393939393939393939393930393939020030009d0100150a

Or provided here: #100:
0108008000e203e8040064040604048dc5410201080002

These currently decode as proper V2GTP messages (when using the correct decoder), although their header bits are incorrect.

Anything else?

In ISO 15118-2, section "7.9.1.3 EXI Settings for application layer messages" describes which EXI format to use. (This is reflected in the same section of ISO 15118-20.)

The EXI standard "Efficient XML Interchange (EXI) Format 1.0 (Second Edition)" describes the header in its section "EXI Header".

The combination of these two standards leads to an 8-bit EXI header b10000000 (0x80), unconditionally. The current checks look only at parts of that specification (EXI Cookie, Presence Bit for EXI Options), and fail to check others (Distinguishing Bits, EXI Format Version):

if (header == '$')
{
result = EXI_ERROR__HEADER_COOKIE_NOT_SUPPORTED;
}
else if (header & 0x20)
{
result = EXI_ERROR__HEADER_OPTIONS_NOT_SUPPORTED;
}

@barsnick barsnick added the bug Something isn't working label Dec 10, 2024
@barsnick barsnick self-assigned this Dec 10, 2024
barsnick added a commit that referenced this issue Dec 10, 2024
Only 0b10000000 = 0x80 is a valid EXI header for our protocols.

This introduces a new error #define and obsoletes two others.

Fixes #102

Signed-off-by: Moritz Barsnick <[email protected]>
@barsnick barsnick mentioned this issue Dec 10, 2024
3 tasks
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

Successfully merging a pull request may close this issue.

1 participant