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

analysisd: fix heap overflow in rootkit decoder. #1825

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Jan 16, 2020

The RK_File function of the rootcheck decoder needs to ensure it doesn't index outside of MAX_AGENTS when trying to find/open a rootcheck file for a given agent.

Prev. to this change the value of i could exceed MAX_AGENTS resulting in a heap buffer overflow accessing rk_agent_ips[i] or rk_agent_fps[i].

The fix is adapted from similar logic in the syscheck decoder, added as a response to a matching vulnerability in that decoder patched in 2012.

Resolves #1820

The `RK_File` function of the rootcheck decoder needs to ensure it
doesn't index outside of `MAX_AGENTS` when trying to find/open
a rootcheck file for a given agent.

Prev. to this change the value of `i` could exceed `MAX_AGENTS`
resulting in a heap buffer overflow accessing `rk_agent_ips[i]` or
`rk_agent_fps[i]`.

The fix is adapted from similar logic in the syscheck decoder, added as
a response to a matching vulnerability in that decoder patched in 2012.
@ddpbsd ddpbsd merged commit 0f3b176 into ossec:master Jan 17, 2020
@cpu cpu deleted the cpu-fix-rootcheck-decoder-heap-overflow branch January 17, 2020 15:14
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.

CVE-2020-8442: analysisd rootcheck decoder: heap overflow in DB_File.
2 participants