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
Limit the memory allocation when parsing ber encoded components in the LiteralSubject field #6782
Limit the memory allocation when parsing ber encoded components in the LiteralSubject field #6782
Conversation
/retest |
906c901
to
c3b690d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wallrj did you fuzz test this approach?
I have not. It's a good idea though...I'm just not too familiar with the process. I see that @AdamKorcz added cert-manager project to the Google oss-fuzz project so perhaps there's a way to trigger that system for every PR? I did link to the fuzz tests in the go-ldap and go-asn1-ber libraries in the PR description. |
Signed-off-by: Richard Wall <richard.wall@venafi.com>
Signed-off-by: Richard Wall <richard.wall@venafi.com>
c3b690d
to
3d7ffdf
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@wallrj: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This will be fixed by go-asn1-ber/asn1-ber#42 |
Fixed in the PRs listed in #7030. |
The go-ldap and asn-ber libraries both limit the message length in their fuzz tests because the default limit is 2GiB which crashes their test runners:
We can set the same limit before invoking
ParseDN
to avoid 2GiB memory being accidentally or maliciously allocated in the webhook component every time a LiteralSubject field value gets parsed.I prefer this small change to the proposed re-implementation of
ParseDN
in #6761 because it allows us to continue using go-ldap library which I predict will do a better job than us of parsing these Subject strings which are compatible with a wide range of LDAP systems.xref:
/kind bug