Commit Graph

23 Commits (b91034b3cf2232319c4219b2bbe929049d735f79)

Author SHA1 Message Date
Ferdinand Thiessen 5b96cca038 chore(Http\Client): fix linting issues
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-07-09 14:42:58 +07:00
georglauterbach 4d517a33ba
fix: remove superflous line
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-11-09 11:56:19 +07:00
georglauterbach 387cd8b771
fix: do not query CNAME if A succeeded already
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-11-06 20:21:38 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Benjamin Gaussorgues 7e4be1fcfd
fix(dns): detect disabled IPv6 support in DNS pinning
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-03-26 12:04:51 +07:00
Robin Kluth 414f8f1f2d Include `hostName:$port` for Host access violation message as well
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +07:00
Robin Kluth 25c0021137 Log Host/IP in `LocalServerException` for `Host violates local access rules`
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +07:00
Daniel Kesselberg f8f985602b
test: add tests for dns pin middleware
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-12 14:04:23 +07:00
Daniel Kesselberg 03f1f1ed2e
enh: skip processing for empty response
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-04 15:28:02 +07:00
Christoph Wurst ce259435c2
Fix DNS Pin Middleware throwing for public IPs
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-11-08 14:18:05 +07:00
Christoph Wurst 8aea25b5b9
Add remote host validation API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-31 16:13:28 +07:00
Christoph Wurst d4b9b010b0
Rename LocalAddressChecker methods to lower case
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-27 13:24:28 +07:00
Côme Chilliet a907b74c2a
Add missing urldecode and idn_to_utf8 calls to local address checker
The call to idn_to_utf8 call is actually to apply normalization

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:20:35 +07:00
Lukas Reschke 84d9b17dc7
Check for !== false instead
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-12 15:06:30 +07:00
Lukas Reschke b0cef8827d Check if dns_get_record returns non-false
`dns_get_record` can return false which results in exceptions such as
the ones shown in https://github.com/nextcloud/server/issues/27870.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-12 13:15:20 +07:00
Sanpi 81c272a8a5 Fixes recursion count incrementation
Signed-off-by: Sanpi <sanpi@homecomputing.fr>
2021-07-07 12:00:00 +07:00
kesselb 9f04a7c71e
Merge pull request #27801 from nextcloud/enh/noid/hardening-dns-pin-middleware
Ignore subdomain for soa queries
2021-07-06 18:55:25 +07:00
Daniel Kesselberg b6530e5e82
Ignore subdomain for soa queries
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-07-05 20:29:06 +07:00
Aaron Ball 484913dc31
Fix DnsPinMiddleware resolve pinning bug
Libcurl expects the value of the CURLOPT_RESOLVE configurations to be an
array of strings, those strings containing a comma delimited list of
resolved IPs for each host:port combination.

The original code here does create that array with the host:port:ip
combination, but multiple ips for a single host:port result in
additional array entries, rather than adding them to the end of the
string with a comma. Per the libcurl docs, the `CURLOPT_RESOLVE` array
entries should match the syntax `host:port:address[,address]`.

This creates a function-scoped associative array which uses `host:port`
as the key (which are supposed to be unique and this ensures that), and
the value is an array containing IP strings (ipv4 or ipv6). Once the
associative array is populated, it is then set to the CURLOPT_RESOLVE
array, imploding the ip arrays using a comma delimiter so the array
syntax matches the expected by libcurl.

Note that this reorders the "foreach ip" and "foreach port" loops.
Rather than looping over ips then ports, we now loop over ports then
ips, since ports are part of the unique host:port map, and multiple ips
can exist therein.

Signed-off-by: Aaron Ball <nullspoon@oper.io>
2021-07-02 16:08:44 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Lukas Reschke 5fe1f134f9 Strictify null check
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:39:24 +07:00
Lukas Reschke 5f3abffe6f Improve networking checks
Whilst we currently state that SSRF is generally outside of our threat model, this is something where we should invest to improve this.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:37:47 +07:00