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

[FIXED] Bytes accounting while reading the INFO protocol #632

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

dmitrmax
Copy link
Contributor

@dmitrmax dmitrmax commented Feb 1, 2023

This is potential buffer overflow vulnerability that can be exploited if server is controlled by an intruder.

If we detect that the buffer contains data then we have to reduce available space for the subsequent read operation. Otherwise read can overwrite memory past the buffer.

P.S.: Just discovered that this function is called only from one place and supplied buffer is always empty there. So actualy not a vulnerabilty but as it is written should be fixed in case anyone in future will use this function with non-empty buffer.

@dmitrmax dmitrmax changed the title Fix buffer overflow vulnurability Fix buffer overflow vulnerability Feb 1, 2023
@kozlovic kozlovic changed the title Fix buffer overflow vulnerability [FIXED] Bytes accounting while reading the INFO protocol Feb 1, 2023
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM! I have updated the title of the PR. Thank you for you contribution.

@kozlovic kozlovic merged commit 9305549 into nats-io:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants