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

[UNDERTOW-2451] fix the information leakage issues #1668

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BFionaccept
Copy link

@BFionaccept BFionaccept commented Sep 25, 2024

Issue: https://issues.redhat.com/browse/UNDERTOW-2451
fix the information leakage issues

AJP Parser: Do not share the decodeBuffer StringBuilder instance between responses
fix the message leak issue in HPACK decoder
@baranowb baranowb added bug fix Contains bug fix(es) under verification Currently being verified (running tests, reviewing) before posting a review to contributor waiting CI check Ready to be merged but waiting for CI check waiting peer review PRs that edit core classes might require an extra review labels Sep 30, 2024
@baranowb
Copy link
Contributor

@BFionaccept could you please update commit messages? Add [UNDERTOW-2451] as prefix and reword first message, since that CVE is very specific and does not cover class you make change to.

@@ -260,12 +258,12 @@ private String readHpackString(ByteBuffer buffer) throws HpackException {
}

private String readHuffmanString(int length, ByteBuffer buffer) throws HpackException {
StringBuilder stringBuilder = new StringBuilder(length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this fix, I referenced the patch for a similar vulnerability (CVE-2020-17527) in the corresponding functional module of Tomcat, as shown in this commit: apache/tomcat@d56293f#diff-98723542790b05d2e3c2dadeef7c632e641e3118b3b809660e9b1ef41686cfe0R226. I removed the final from the StringBuilder stringBuilder declaration, enhancing code flexibility and allowing for future reassignment if needed.

Certainly, I think it is also acceptable to retain the final modifier.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I’m sorry, I accidentally deleted a previous conversation.

@baranowb baranowb changed the title fix the information leakage issues [UNDERTOW-2451] fix the information leakage issues Sep 30, 2024
@BFionaccept
Copy link
Author

@baranowb Hi baranowb, I'm unable to view this issue: https://issues.redhat.com/browse/UNDERTOW-2451. Could you please help add me to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Contains bug fix(es) under verification Currently being verified (running tests, reviewing) before posting a review to contributor waiting CI check Ready to be merged but waiting for CI check waiting peer review PRs that edit core classes might require an extra review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants