fix(security): validate federation server against trusted-servers list (OC10-100)#598
fix(security): validate federation server against trusted-servers list (OC10-100)#598DeepDiver1975 wants to merge 6 commits into
Conversation
Replaces the always-true isServerAllowed() stub with a real check against ownCloud's federation trusted-servers list (OCA\Federation\TrustedServers). When TrustedServers is null (federation app not installed), all remote federation requests are denied. URL comparison strips trailing slashes and checks both http/https scheme variants to tolerate minor admin-input differences. Fixes OC10-100 (SSRF via federated endpoint, CVSS 7.1). Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Explicitly register FederationService in the app container so that TrustedServers (from the federation app) is injected when available, and null is passed when the federation app is not installed. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Code Review — PR #598OverviewFixes an SSRF vulnerability where Code Quality
Potential Issues
Suggestions
Security AssessmentThe fix correctly closes the SSRF: the default is now deny-all (null Verdict: Approve with minor fix — the |
… test - Application.php: replace \OC::$server->query() with the already-captured $server variable for consistency and testability - FederationServiceTest: remove testIsServerAllowedReturnsFalseWhenListIsEmpty which was identical to testIsServerAllowedReturnsFalseForUntrustedServer Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Code Review — PR #598 (updated)OverviewFixes SSRF in the Code Quality
Remaining Minor Points
Security Assessment
Verdict: Ready to merge. The two issues from the first review are resolved. Remaining points are cosmetic or pre-existing. |
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…tedServers The federation app is an optional runtime dependency not present in Phan's analysis path. Suppress PhanUndeclaredClass* at the five sites that reference TrustedServers, matching the project's established inline-suppression pattern. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
…ration line Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
|
I'd prefer for the admin to provide the list of trusted servers via configuration (either system config or app config). This way, the app remains independent (not relying on the federation app) |
|
The list of trusted servers is already known to the system. Maintaining another list is just pure pain and absolutely not user friendly. |
|
The problems I see are:
It would be much easier if the trusted servers were part of core |
yes - and in the sense of 'federation deactivated' in this scenario: no collabora federation will work as well. But well - there is also the federatedfilesahring app. As usual a super messy design over all ....
One could repurpose the federation app ....
This is absolutely true - nothing to argue - but we will not change this as of now. |
45d01bd to
b67fa7f
Compare
Summary
isServerAllowed()stub inFederationServicewith a real check against ownCloud's federation trusted-servers list (OCA\Federation\TrustedServers)TrustedServersis null), all remote federation requests are denied by default (secure default)FederationServicein the DI container soTrustedServerscan be injected when the federation app is availableFixes OC10-100 (SSRF via federated endpoint, CVSS 7.1).
Test plan
isServerAllowed()covering: null TrustedServers → deny, exact match, trailing slash stripping (single and multiple), http↔https scheme swap, untrusted server → false, empty list → falsephpunit --testsuite unit --filter testIsServerAllowed— all 7 tests pass🤖 Generated with Claude Code