Skip to content

Guard empty filename stripping in GetAlertData. - #2358

Merged
atomicturtle merged 1 commit into
ossec:mainfrom
atomicturtle:fix/getalert-empty-filename
Oct 12, 2026
Merged

atomicturtle merged 1 commit into
ossec:mainfrom
atomicturtle:fix/getalert-empty-filename

Conversation

@atomicturtle

Copy link
Copy Markdown
Member

A syscheck alert line of the form Integrity checksum changed for: ' with nothing after the opening quote made strlen zero. Subtracting one from that unsigned length wrapped, and the trailing-quote strip wrote a NUL one byte before the strdup buffer. Require a non-empty payload before stripping, and treat a missing path as NULL like other alert fields.

A syscheck alert line of the form Integrity checksum changed for: '
with nothing after the opening quote made strlen zero. Subtracting one
from that unsigned length wrapped, and the trailing-quote strip wrote
a NUL one byte before the strdup buffer. Require a non-empty payload
before stripping, and treat a missing path as NULL like other alert
fields.

Signed-off-by: Scott R. Shinn <scott@atomicorp.com>
@atomicturtle
atomicturtle merged commit e59d163 into ossec:main Oct 12, 2026
5 checks passed
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.

1 participant