Skip to content

Fix @rbl false-negative when getaddrinfo returns IPv6 first#116

Open
Easton97-Jens wants to merge 1 commit into
v3/masterfrom
codex/propose-fix-for-rbl-false-negative
Open

Fix @rbl false-negative when getaddrinfo returns IPv6 first#116
Easton97-Jens wants to merge 1 commit into
v3/masterfrom
codex/propose-fix-for-rbl-false-negative

Conversation

@Easton97-Jens
Copy link
Copy Markdown
Owner

Motivation

  • Fix a security-regression in Rbl::evaluate() where getaddrinfo() could return an AF_INET6 entry before a valid AF_INET RBL response and the code returned false after inspecting only the first addrinfo, causing possible fail-open behavior for @rbl rules.

Description

  • Iterate the entire addrinfo linked list returned by getaddrinfo() and select the first AF_INET entry to populate the sockaddr_in and call furtherInfo(); only return false after scanning all results and finding no IPv4 entry (changes in src/operators/rbl.cc).

Testing

  • Ran test -d build, attempted cmake --build build -j2 --target modsecurity (failed with Error: could not load cache due to local build cache/config state), and verified the source diff and affected lines with git diff and nl -ba src/operators/rbl.cc to confirm the intended change.

Codex Task

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant