fix(security): forward-verify PTR result in remote_client_authorized() (1.2.x)#6968
Merged
TheWitness merged 2 commits intoCacti:1.2.xfrom Apr 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens remote_client_authorized() in Cacti’s remote agent endpoint to mitigate a reverse-DNS (PTR) spoofing authorization bypass by adding a forward-DNS verification step after gethostbyaddr().
Changes:
- Perform a forward DNS lookup on the PTR hostname and reject authorization if it does not resolve back to the client IP.
- Add a WARNING auth log entry for PTR/forward mismatches.
TheWitness
requested changes
Apr 5, 2026
614e43d to
5533e6f
Compare
Use dns_get_record(DNS_A + DNS_AAAA) for forward verification to support dual-stack and round-robin DNS. Sanitize PTR hostname in log output. Use SECURITY logging category. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
5533e6f to
8ce259c
Compare
2 tasks
TheWitness
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gethostbyaddr()inremote_client_authorized()Backport of #6951. An attacker with PTR record control can spoof a trusted poller hostname to bypass remote agent authorization.
Test plan