Skip to content

Commit 452e6c8

Browse files
committed
Merge branch 'dev'
2 parents bd7530d + 2126cdb commit 452e6c8

File tree

24 files changed

+192
-44
lines changed

24 files changed

+192
-44
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
mac:
7474
runs-on: macos-14
7575
env:
76-
DEVELOPER_DIR: /Applications/Xcode_15.4.app
76+
DEVELOPER_DIR: /Applications/Xcode_16.2.app
7777

7878
steps:
7979
- name: Checkout

.github/workflows/check.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,43 @@ on:
2121

2222
jobs:
2323
linux:
24-
runs-on: ubuntu-latest
24+
runs-on: ${{ matrix.os }}
2525
strategy:
2626
fail-fast: false
2727
matrix:
2828
include:
29+
#gcc
2930
- compiler: gcc
3031
version: 11
32+
os: ubuntu-latest
3133
- compiler: gcc
3234
version: 12
35+
os: ubuntu-latest
36+
- compiler: gcc
37+
version: 13
38+
os: ubuntu-latest
3339
- compiler: gcc
40+
version: 14
41+
os: ubuntu-latest
42+
#clang
43+
- compiler: clang
3444
version: 13
35-
# See https://github.com/actions/runner-images/issues/8659
36-
# - compiler: clang
37-
# version: 13
38-
# - compiler: clang
39-
# version: 14
45+
os: ubuntu-22.04
46+
- compiler: clang
47+
version: 14
48+
os: ubuntu-22.04
4049
- compiler: clang
4150
version: 15
51+
os: ubuntu-22.04
52+
- compiler: clang
53+
version: 16
54+
os: ubuntu-22.04
4255
- compiler: clang
4356
version: 17
57+
os: ubuntu-latest
58+
- compiler: clang
59+
version: 18
60+
os: ubuntu-latest
4461
steps:
4562
- name: Checkout
4663
uses: actions/checkout@v4
@@ -54,8 +71,10 @@ jobs:
5471
wget https://apt.llvm.org/llvm.sh
5572
chmod u+x llvm.sh
5673
sudo ./llvm.sh ${{ matrix.version }}
74+
sudo apt-get install -y clang-tools-${{ matrix.version }} libc++-${{ matrix.version }}-dev libc++abi-${{ matrix.version }}-dev
5775
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
5876
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
77+
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
5978
fi
6079
6180
if [[ '${{ matrix.compiler }}' == 'gcc' ]]; then
@@ -110,9 +129,9 @@ jobs:
110129
- os: macos-13
111130
xcode: '15.2'
112131
- os: macos-14
113-
xcode: '14.3.1'
132+
xcode: '15.4'
114133
- os: macos-14
115-
xcode: '15.3'
134+
xcode: '16.2'
116135
env:
117136
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
118137
steps:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: macos-14
7676
needs: prepare
7777
env:
78-
DEVELOPER_DIR: /Applications/Xcode_15.4.app
78+
DEVELOPER_DIR: /Applications/Xcode_16.2.app
7979

8080
steps:
8181
- name: Checkout

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## Unreleased
77

8+
### Added
9+
* `--source-port` command line argument and `source-port` config file option to set the source port for multicast messages
10+
for better firewall interoperability.
11+
* Configuration files for `firewalld`. These are now also delivered and used in RPM binary packages.
12+
13+
### Changed
14+
- Updated 3rd party dependencies
15+
- Firewall configuration files now live under `config/firewalls`
16+
817
## [1.15] - 2024-10-03
918

1019
### Changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ sudo dnf install wsddn
324324
#sudo yum install wsddn
325325
```
326326

327-
On first install firewall ports `5357/tcp` and `3702/udp` will be opened.
327+
On first install firewall will be configured to open `wsddn` service.
328328

329329
Enable and start the daemon:
330330

@@ -661,7 +661,7 @@ Command line flags and configuration file entries are documented in `man wsddn`
661661

662662
### Firewall Setup
663663

664-
<small>Note: The following instructions are copied verbatim from [wsdd][wsdd] one since the requirements are identical</small>
664+
<small>Note: The following instructions are copied almost verbatim from [wsdd][wsdd] since the requirements are identical</small>
665665

666666
Traffic for the following ports, directions and addresses must be allowed.
667667

@@ -673,12 +673,17 @@ Traffic for the following ports, directions and addresses must be allowed.
673673

674674
You should further restrict the traffic to the (link-)local subnet, e.g. by using the `fe80::/10` address space for IPv6. Please note that IGMP traffic must be enabled in order to get IPv4 multicast traffic working.
675675

676+
For UFW and firewalld, application/service profiles can be found under `config/firewalls`. If using binary installation packages these are provided
677+
as part of the installation. Note that UFW profiles only allow to grant the traffic on specific UDP and TCP ports, but a restriction on the IP range (like link local for IPv6) or the multicast traffic is not possible.
678+
676679
### Security
677680

678-
There are two main security concerns with a daemon that delivers data about local machine over the network
681+
There are four main security concerns with a daemon that accepts network requests and delivers data about local machine over the network
679682

680-
1. A bug inside daemon code may allow remote attacker to penetrate the machine running it.
683+
1. A bug inside the daemon code may allow a remote attacker to penetrate the machine running it.
681684
2. The information legitimately provided by the daemon will disclose something to an attacker that would otherwise remain unknown, enabling him to mount further attacks.
685+
3. A bug or even the _normal functionality_ of the daemon might allow a remote attacker to use it to mount further attacks against other systems. For example it might be possible to "convince" the daemon to become a part of a distributed denial of service (DDoS) attack.
686+
4. A bug or a normal operation of the daemon might allow a remote attacker to make it or even the entire machine hosting it unresponsive resulting in a denial of service.
682687

683688
Currently the implementation ignores the second concern. The things **wsdd-native** discloses are the existence of the local host, its name, presence of Samba on it and domain/workgroup membership. All of these are generally disclosed by Samba itself via SMB broadcasts so, assuming the firewall is configured as described above, there is no net gain for an attacker. WS-Discovery protocol contains provisions for encrypting its HTTP traffic and potentially authenticating clients accessing your host via their client certificates. This limits exposure somewhat but at a significant configuration and maintenance cost. If there is interest in any of it it is possible to easily add this functionality in a future version.
684689

@@ -688,7 +693,15 @@ The first concern is by far the most significant one. All software contains bugs
688693

689694
These measures are automatic and cannot be bypassed. Taken together they should limit the fallout of any vulnerability though, of course, nothing ever can be claimed to be 100% secure.
690695

691-
Note that when running on `systemd` systems it is recommended to use its `DynamicUser` facility instead of running as root and relying on the measures above. The Debian/Ubuntu/Arch installer does so.
696+
Note that when running on `systemd` systems it is recommended to use its `DynamicUser` facility instead of running as root and relying on the measures above. The Debian/Ubuntu/Fedora/Arch binary packages do so.
697+
698+
The third concern is also a significant one. Even in absence of any bugs a completely correct implementation of WS-Discovery protocol is known to be vulnerable to these kinds of attacks. See for example
699+
[here](https://blogs.akamai.com/sitr/2019/09/new-ddos-vector-observed-in-the-wild-wsd-attacks-hitting-35gbps.html) and
700+
[here](https://www.zdnet.com/article/protocol-used-by-630000-devices-can-be-abused-for-devastating-ddos-attacks/).
701+
Bugs (always a possibility) can make things even worse. As far as I know there is no effective mitigation to this threat that **wsdd-native** can implement in code. The only way to prevent these kinds of attacks is to __never__ expose **wsdd-native** ports to open internet via [firewall configuration](#firewall-setup). Given that the whole purpose of this daemon is to enable interoperability with Windows via SMB protocol there is probably never a good
702+
reason to let it accept and send traffic outside of a local network.
703+
704+
The fourth concern, while also present, is less severe than the above. **wsdd-native** is single threaded and so, even if overwhelmed by traffic, will not stress more than 1 CPU core. Its memory consumption is bounded so, in absence of bugs, it will not stress system memory either. It can itself be rendered unresponsive, of course, by too much traffic but, considering that it probably isn't a vital service for anyone, this isn't something that would excite any attacker. Possible bugs change this picture, however. If the network process is hijacked, even if mitigations for the 1st concern prevent further system penetration, the attacker can still make the network process consume too much CPU and memory. You can try to mitigate against this possibility by limiting daemon CPU and memory usage via [cgroups](https://www.redhat.com/en/blog/cgroups-part-four) or other mechanisms. However, a much simpler solution to these issues is the same as the above - never expose the daemon to the open internet.
692705

693706
### Custom metadata
694707

cmake/dependencies.cmake

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ list(APPEND DEPENDECIES_JSON "\"argum\": \"pkg:github/${ARGUM_REPO}@${ARGUM_VER}
2222
#################################################
2323

2424
set(SYS_STRING_REPO gershnik/sys_string)
25-
set(SYS_STRING_VER v2.14)
25+
set(SYS_STRING_VER v2.16)
2626
FetchContent_Declare(sys_string
2727
GIT_REPOSITORY https://github.com/${SYS_STRING_REPO}.git
2828
GIT_TAG ${SYS_STRING_VER}
@@ -77,7 +77,7 @@ if (NOT LibXml2_FOUND)
7777
set(LIBXML2_WITH_MODULES OFF)
7878
set(LIBXML2_WITH_PROGRAMS OFF)
7979

80-
set(LIBXML_VER v2.13.4)
80+
set(LIBXML_VER v2.13.5)
8181
FetchContent_Declare(libxml2
8282
GIT_REPOSITORY https://gitlab.gnome.org/GNOME/libxml2.git
8383
GIT_TAG ${LIBXML_VER}
@@ -91,7 +91,7 @@ endif()
9191
#################################################
9292

9393
set(UUID_REPO gershnik/libuuid-cmake)
94-
set(UUID_VER v2.40.2)
94+
set(UUID_VER v2.40.3)
9595
FetchContent_Declare(libuuid
9696
GIT_REPOSITORY https://github.com/${UUID_REPO}.git
9797
GIT_TAG ${UUID_VER}
@@ -105,7 +105,7 @@ list(APPEND DEPENDECIES_JSON "\"libuuid\": \"pkg:github/${UUID_REPO}@${UUID_VER}
105105
set(FMT_INSTALL OFF)
106106

107107
set(FMT_REPO fmtlib/fmt)
108-
set(FMT_VER 11.0.2)
108+
set(FMT_VER 11.1.1)
109109
FetchContent_Declare(fmt
110110
GIT_REPOSITORY https://github.com/${FMT_REPO}
111111
GIT_TAG ${FMT_VER}
@@ -122,11 +122,16 @@ set(SPDLOG_NO_TLS ON CACHE BOOL "prevent spdlog from using thread local storage"
122122
set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "Use external fmt library instead of bundled")
123123

124124
set(SPDLOG_REPO gabime/spdlog)
125-
set(SPDLOG_VER v1.14.1)
125+
set(SPDLOG_VER v1.15.0)
126126
FetchContent_Declare(spdlog
127-
GIT_REPOSITORY https://github.com/${SPDLOG_REPO}
128-
GIT_TAG ${SPDLOG_VER}
129-
GIT_SHALLOW TRUE
127+
# GIT_REPOSITORY https://github.com/${SPDLOG_REPO}
128+
# GIT_TAG ${SPDLOG_VER}
129+
# GIT_SHALLOW TRUE
130+
131+
URL https://github.com/${SPDLOG_REPO}/tarball/${SPDLOG_VER}
132+
133+
PATCH_COMMAND patch -p0 -s -f -i ${CMAKE_CURRENT_LIST_DIR}/patches/spdlog.diff
134+
LOG_PATCH ON
130135
)
131136
list(APPEND DECLARED_DEPENDENCIES spdlog)
132137
list(APPEND DEPENDECIES_JSON "\"spdlog\": \"pkg:github/${SPDLOG_REPO}@${SPDLOG_VER}\"")
@@ -150,7 +155,7 @@ list(APPEND DEPENDECIES_JSON "\"tomlplusplus\": \"pkg:github/${TOMPLUSPLUS_REPO}
150155
#################################################
151156

152157
set(OUTCOME_REPO ned14/outcome)
153-
set(OUTCOME_VER v2.2.10)
158+
set(OUTCOME_VER v2.2.11)
154159
# FetchContent_Declare(outcome
155160
# GIT_REPOSITORY https://github.com/${OUTCOME_REPO}
156161
# GIT_TAG ${OUTCOME_VER}

cmake/patches/spdlog.diff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- include/spdlog/fmt/fmt.h
2+
+++ include/spdlog/fmt/fmt.h
3+
@@ -27,4 +27,5 @@
4+
#else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib
5+
#include <fmt/core.h>
6+
#include <fmt/format.h>
7+
+ #include <fmt/xchar.h>
8+
#endif
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<service>
3+
<short>WS-Discovery Host Daemon (HTTP Interface)</short>
4+
<description>Allows your machine to be discovered by Windows 10 and above systems and displayed by their Explorer &quot;Network&quot; views.</description>
5+
<port port="5357" protocol="tcp"/>
6+
</service>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<service>
3+
<short>WS-Discovery Host Daemon</short>
4+
<description>Allows your machine to be discovered by Windows 10 and above systems and displayed by their Explorer &quot;Network&quot; views.</description>
5+
<port port="3702" protocol="udp"/>
6+
<destination ipv4="239.255.255.250" ipv6="FF02::C"/>
7+
<include service="wsddn-http"/>
8+
</service>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[wsddn]
2+
title=WS-Discovery Host Daemon
3+
description=Allows your machine to be discovered by Windows 10 and above systems and displayed by their Explorer "Network" views.
4+
ports=3702/udp|5357/tcp

0 commit comments

Comments
 (0)