-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TLS security issue: tls.verify is not validating host subject alternative name #8072
Comments
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
Because there was no reaction on this issue since Oct. 20. and because in my oppinion it is critical, I placed it as a security vulnerability now: https://github.com/fluent/fluent-bit/security/advisories/GHSA-rvxv-vp29-qf2h |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
This issue was closed because it has been stalled for 5 days with no activity. |
re-opening and assigning to @cosmo0920 for triagging |
Bug Report
If tls.verify is set to on on the client side, the servers's subject alternative name (SAN) will still not be validated.
fluent-Bit Version 2.1.10
Ubuntu 22.04.2 LTS
Reproduction
The client establishs a connection with the host other.fluent-backoffice.de but get a certificate presented by the host with the SAN my.fluent-backoffice.de. It is obvious, that this names not match.
You find all necessary certificates and keys for reproduction in the zip file attached to this issue.
Excerpt from server's certificate data:
Fluent Bit configuration on client site:
/etc/hosts on client site:
Fluent Bit configuration on server site:
Expected behaviour
If, like in that case, the host presents a certificat not matching the name of the host called by the client, the host name validation must fail and the TLS connection must not be established. Because of tls.debug is set to 4, in the client's site Fluent Bit log, there should be [debug] and/or [error] messages saying something like "host name validation failed".
Actual behaviour
The connection is established without any error. No error or debug message occurs in the client's or host's log. tls.debug 4 does not generate any tls [debug] message at all I think.
Countercheck
Checked with curl, if the expected behavour will occur:
You will get that messages:
That means, that curl validates the host's certificate as expected. It detects, that the name in the hosts's certificate doesn't match the host called by the client. With curl, all is fine.
Now change the /etc/hosts to verify what happens, if the name in the host's certificate matches the name of the host called:
Also in the client.config, change the host to:
After restarting Fluent-Bit, it works as expected. The tls connection is established and messages are successfully send from the client to the server.
curl also works as expected:
Now you will get the messages:
Unqualified guess about the cause
flb_ouput.c line 871:
tls.verify and tls.debug are the only two parameters in that code block, where a check against tmp is done. Is something wrong here ??
Please add the correct hostname validation to Fluent Bit.
necessary-certs.zip
The text was updated successfully, but these errors were encountered: