Repository navigation
feat(ocm): add safe received webapp launch - #5850
Merged
Merged
Conversation
MahdiBaghbani
requested review from
diocas,
glpatcern,
jessegeens and
rawe0
as code owners
September 29, 2026 10:16
This was referenced Sep 29, 2026
MahdiBaghbani
force-pushed
the
safe-received-webapp-launch
branch
2 times, most recently
from
October 8, 2026 08:29
82cae53 to
b87bb54
Compare
glpatcern
force-pushed
the
safe-received-webapp-launch
branch
3 times, most recently
from
October 12, 2026 14:26
2a3febd to
fb526ee
Compare
MahdiBaghbani
force-pushed
the
safe-received-webapp-launch
branch
from
October 15, 2026 20:56
d999d31 to
4fa0371
Compare
glpatcern
force-pushed
the
safe-received-webapp-launch
branch
3 times, most recently
from
October 20, 2026 09:20
4de26bc to
6a0ab85
Compare
MahdiBaghbani
force-pushed
the
safe-received-webapp-launch
branch
from
October 30, 2026 15:36
6a0ab85 to
9e33682
Compare
glpatcern
force-pushed
the
safe-received-webapp-launch
branch
from
November 4, 2026 09:26
9e33682 to
7ac3647
Compare
glpatcern
approved these changes
Nov 4, 2026
glpatcern
force-pushed
the
safe-received-webapp-launch
branch
from
November 4, 2026 09:30
7ac3647 to
1587181
Compare
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
Signed-off-by: Mahdi Baghbani <[email protected]>
glpatcern
force-pushed
the
safe-received-webapp-launch
branch
from
November 4, 2026 11:38
1587181 to
9d30079
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48
Summary
OpenInApp: load the received share, check the stored offer withValidateWebappLaunch, validate the requested file path, discover the sender, and exchange the shared secret for an access token. The response staysapp_urlandaccess_token, and the secret never leaves the server. Error text goes throughredactLaunchError, so neither the secret nor the token is echoed back.must-exchange-tokenand allow theblanktarget on both sides,must-use-mfais refused (403) unlessmfa_policyisoff, the app URI and token URL have to be https without userinfo, and the share-relative path is checked up front - traversal segments, absolute suffixes, literal or encoded dot segments and empty interior segments are rejected before discovery, with encoded forms decoded first. The path is also joined onto the app URI before discovery, so a path that can't be joined fails before any token is minted.mfa_policyunder[http.services.wellknown.ocmprovider]:reject(default) oroff. Reva has no per-user MFA proof, but a deployment where every login already goes through OIDC with a hardware token can setoffto acceptmust-use-mfaoffers. Nothing is advertised, sooffonly relaxes our own check and makes noenforce-mfaclaim in discovery. An unknown value fails startup.DiscoverandExchangeToken, built at init from the ScienceMesh transport config, so a token host that differs from the discovery host still goes through the same dial guard. Nothing is cached, each launch discovers again, andclient_idis the configured provider domain.flowchart TD REQ["POST /sciencemesh/open-in-app"] --> SH["load stored share and webapp offer"] SH --> V{"ValidateWebappLaunch"} V -->|"must-use-mfa and mfa_policy = reject"| MFA["403, no dial"] V -->|"no must-exchange-token, no blank target, or malformed URI"| BAD["400, no dial"] V -->|"ok"| PATH{"validateShareFilePath"} PATH -->|"traversal, absolute suffix, or dot segment"| BAD PATH -->|"valid"| URI{"requireHTTPSAppURI"} URI -->|"not https or userinfo"| BAD URI -->|"https"| JOIN{"joinShareRelativePath"} JOIN -->|"cannot join"| BAD JOIN -->|"app_url"| ORG{"senderDiscoveryOrigin"} ORG -->|"invalid absolute WebDAV URI"| BAD ORG -->|"WebDAV origin, else webapp origin"| C{"public-only dial guard"} C -->|"loopback, or private outside allowed_federation_cidrs"| REF["refused"] C -->|"public, or private within allowed_federation_cidrs"| D["Discover"] D --> T["resolve token endpoint, https"] T --> X["ExchangeToken, client_id = provider domain"] X --> OUT["app_url + access_token"] OUT -.->|"later in the stack"| SRV["served launcher page posts the token to the app, this JSON route is removed"]Later in the stack, #5906 serves this launch as a CSP-scoped page that posts the token straight to the app, and #5909 removes
/sciencemesh/open-in-app. The checks above stay the same; at the top of the stack the access token never reaches the browser.The part you might ask about is
senderDiscoveryOrigin. It takes the first absolute WebDAV origin, and an invalid one fails the launch instead of falling back to the webapp URI, so a broken WebDAV entry can't steer discovery to another host. #5851 replaces this with the share sender's idp.The other thing is private networks. The launch client is built once at init from the ScienceMesh
publicOCMTransportConfig(), so it shares the service's timeout, TLS settings andallowed_federation_cidrs. A sender on a private network is refused unless its range is explicitly configured; loopback and environment proxies stay disabled on this service. Testbeds that run OCM traffic through a MITM proxy on a private Docker network put that network inallowed_federation_cidrs.