-
Notifications
You must be signed in to change notification settings - Fork 160
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
[security] Reliance on default encoding #488
Comments
This was opened due to the Trail of Bits security review |
@pierDipi any thoughts on this one? |
duglin
pushed a commit
to duglin/sdk-java
that referenced
this issue
Dec 8, 2022
Closes cloudevents#488 Signed-off-by: Doug Davis <[email protected]>
duglin
pushed a commit
to duglin/sdk-java
that referenced
this issue
Dec 8, 2022
Closes cloudevents#488 Signed-off-by: Doug Davis <[email protected]>
duglin
pushed a commit
to duglin/sdk-java
that referenced
this issue
Dec 8, 2022
Closes cloudevents#488 Signed-off-by: Doug Davis <[email protected]>
duglin
pushed a commit
to duglin/sdk-java
that referenced
this issue
Dec 8, 2022
Closes cloudevents#488 Signed-off-by: Doug Davis <[email protected]>
pierDipi
pushed a commit
that referenced
this issue
Jan 5, 2023
Closes #488 Signed-off-by: Doug Davis <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Multiple instances were identified in which the getByte() standard Java API is used without specifying any encoding. Doing so causes the Java SDK to rely on the system default encoding, which can differ across platforms and systems used by event actors and cause unexpected differences in processing of event data.
The specification states that appropriate and RFC-compliant encodings MUST be followed, but the implementation in the Java SDK and documentation should be improved to highlight the importance of matching encoding across actors.
Not all observed instances are necessarily problematic, as they are handling binary data. However, this behavior should be documented and handled in the SDK implementation, documentation, and supplied examples.
code
code
Exploit Scenario
The event producer, the intermediary (using the SDK), and the consumer use different default encodings for their systems. Without acknowledging a fixed encoding, the data is handled and processed using an unintended encoding, resulting in unexpected behavior.
Recommendations
Short term, improve the SDK documentation to highlight the importance of matching encoding acros actors.
Long term, review all similar instances across the SDK and improve test cases to cover handling of message and data encoding.
References
The text was updated successfully, but these errors were encountered: