The vulnerability is a Server-Side Request Forgery (SSRF) in the out_http plugin of Fluentd. It arises because the endpoint configuration parameter allows for placeholder expansion. If these placeholders are populated with untrusted user input, an attacker can control the destination of the outbound HTTP requests.
The investigation started by examining the provided reference URLs. The release notes for the patched version v1.19.3 pointed to pull request #5394, titled "out_http: add strict host validation for dynamic endpoints". This PR contained the security fix.
The commit 0b224aa38bcce23d8b72baddf4ddd126435ee7a7 from this pull request modifies lib/fluent/plugin/out_http.rb.
The core of the vulnerability lies in the parse_endpoint method of the Fluent::Plugin::HttpOutput class. The diff shows that the original code would take the endpoint string after placeholder substitution and parse it directly with URI.parse(). This lack of validation on the hostname allowed the SSRF.
The patch introduces a mitigation by first parsing the endpoint template in the configure method to establish a baseline host. Then, in parse_endpoint, after substituting placeholders, it compares the new URI's host with the original one. If the host has been changed by a placeholder, it's validated against a new allowed_hosts list. If the list is empty or the host is not in it, an error is raised, preventing the malicious request.
Therefore, the parse_endpoint function is the precise location of the vulnerability, as it's where the user-controlled data is processed to form the request URI. Any runtime profile during exploitation would show this function in the stack trace just before the outbound HTTP connection is attempted.