Repository navigation
Conversation
Require administrator access when enabled. Cover the default denial and role requirement with unit tests. Signed-off-by: Nicholas Sielicki <opensource@nslick.com>
|
Prior to this commit, any authenticated user can dump a core and plausibly escalate privileges to administrator by reading the jwt signing key from the core and forging an admin token. Please take this patch. |
PoC results (test instance only)Tested against an instance I control. No administrator credential was used for the dump request.
Test config ( flags:
no_connect: true
no_share_scan: true
no_version_check: true
web:
authentication:
username: slskd
password: CANARY-web-password-0123456789
jwt:
key: CANARY-jwt-key-0123456789abcdefXYZ
api_keys:
poc:
key: CANARY-readonly-key-0123456789
role: readonly
cidr: 0.0.0.0/0,::/0
soulseek:
username: canary-poc-user
password: CANARY-slsk-password-01234567891. Authorization reaches the dump code# no credential
curl -o /dev/null -w '%{http_code}\n' \
http://127.0.0.1:5030/api/v0/application/dump
# 401
# read-only API key only
curl -H 'X-API-Key: CANARY-readonly-key-0123456789' \
http://127.0.0.1:5030/api/v0/application/dump \
-o slskd.dmpWith the stock image the read-only request is authorized and reaches That is the downloaded So stock current Docker is accidentally mitigated by the dump tool being unable to run. That is not an authorization check. 2. Once
|
Summary
Disable the process memory dump endpoint by default and require administrator access when enabled. Add configuration documentation and unit tests for both safeguards.
Testing
Built with .NET 10 via Nix; all 1,475 existing unit tests and two new tests passed. Changed C# files pass formatting.