Commit graph

10 commits

Author SHA1 Message Date
Daniel Kesselberg
c4286730fa
enh: skip processing for empty response
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-05 12:22:58 +02:00
Lukas Reschke
5dcc18af46 Check for !== false instead
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-12 14:46:43 +00:00
Lukas Reschke
525dfd2f4d 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 14:46:42 +00:00
MichaIng
cd0343e6b9
Merge pull request #27825 from nextcloud/backport/27801/stable22
[stable22] Ignore subdomain for soa queries
2021-07-09 15:44:14 +02:00
Sanpi
2ed3574ea0
Fixes recursion count incrementation
Signed-off-by: Sanpi <sanpi@homecomputing.fr>
2021-07-07 12:59:22 +02:00
Daniel Kesselberg
a626792e15 Ignore subdomain for soa queries
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-07-06 16:58:15 +00:00
Aaron Ball
f8db7ce8f5 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-05 15:40:06 +00:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Lukas Reschke
5fe1f134f9 Strictify null check
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:39:24 +00: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 +00:00