fix(DnsPinning): Ensure to always lookup based on FQDN#59147
Conversation
|
/backport to stable32 |
31e56ed to
d413f74
Compare
|
/backport to stable33 |
b6f77cb to
aa45c07
Compare
provokateurin
left a comment
There was a problem hiding this comment.
Uh that is quite something 😅
aa45c07 to
2d3b281
Compare
| * @param string $hostname | ||
| * @return string |
There was a problem hiding this comment.
nit: @param/@return phpdoc comments are redundant with the type hints
There was a problem hiding this comment.
True, I have to figure out how to get PhpStorm to not do that when adding phpdoc comments.
2d3b281 to
f728b49
Compare
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
f728b49 to
5bc0ba6
Compare
|
I've realized that my fix has an unexpected side effect. It totally prevents the usage of relative domains, as all domains are being treated as FQDNs from a DNS point of view. That's totally fine for the app store - but a bit unexpected for other developers and might break some apps, as it's usually possible to use both relative and absolute domains on any HTTP request. As most apps use our implementation, I lean on fixing it before someone might complain about it (and hence merging it into stable33 and stable32). I can think of two ways to tackle that:
The suggested change here to discard the record if it doesn't match the requested host would have the same unexpected side effect as my fix does. So, that solution is not possible, unfortunately. Also, as the example with Any thoughts on this? @kesselb @provokateurin @ChristophWurst |
|
Unfortunately I absolutely lack expertise in this area. I don't know. |
Summary
After upgrading my private server from Debian 12 to Debian 13, I've experienced the same issue mentioned in #56489 which resulted in the app store to be totally unusable. Upgrading the Nextcloud version worked without any issues tho.
The investigation got the following results:
github.com, it tried to resolve A, AAAA and CNAME recordsgithub.com.dreschner.netFor reproducing the issue on command line level, you can use the following command on a server with IPv6 connectivity:
The reason is that we don't use FQDNs for resolving the DNS records and GitHub doesn't provide an AAAA record. Therefore, the program behind
dns_get_records()looks for the host as subdomain of the local domain name. This works as I have a wildcard AAAA record set-up.The fix is easy: just add a
.at the end to make the requested domain name a FQDN and prevent the lookup under the local domain name when no record is being found in the first lookup.Checklist
3. to review, feature component)stable32)AI (if applicable)