Skip to content

feat(wopi): WOPI proof - #4902

Merged
elzody merged 2 commits into
mainfrom
feat/wopi-proof
Aug 14, 2025
Merged

feat(wopi): WOPI proof#4902
elzody merged 2 commits into
mainfrom
feat/wopi-proof

Conversation

@elzody

@elzody elzody commented Jul 22, 2025

Copy link
Copy Markdown
Collaborator
  • Target version: main

Summary

WOPI proof validation ensures that WOPI requests are genuine. It also helps in cases that prevent download, as without it anyone with an access token and the WOPI source URL can still get the file contents.

You can generate a key pair by running:

sudo coolconfig generate-proof-key

or if you are using a configuration directory other than /etc, you can manually invoke ssh-keygen:

ssh-keygen -t rsa -N "" -m PEM -f /some/path/proof_key

If you are using Docker you need to mount the key pair into the container as a volume.

Once generated, you need to restart coolwsd for the server to start using it. Nextcloud will automatically detect that a proof is being sent with the request and begin verifying each request from there on out. If you remove the key pair, the Collabora server will still continue to use them until it is restarted. Again, Nextcloud would detect this and stop verifying requests. It does this by detecting discrepancies between the cached discovery information from the Collabora server and whether or not the server is sending a proof in the X-WOPI-Proof header. If necessary, the discovery information will be re-fetched and cached in order to obtain the proof key as well as the RSA modulus and exponent so that it can verify the signature of the proof sent in the request header.

TODO

  • Unit tests

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@elzody elzody self-assigned this Jul 22, 2025
@elzody elzody added the enhancement New feature or request label Jul 22, 2025
@elzody elzody added 2. developing Work in progress php Pull requests that update Php code tests feature: wopi host labels Jul 22, 2025
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Jul 22, 2025
@elzody elzody moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Productivity team Jul 22, 2025
@elzody
elzody force-pushed the feat/wopi-proof branch from bb07c82 to 9cc09a3 Compare July 29, 2025 21:45
@elzody
elzody marked this pull request as ready for review July 29, 2025 22:27
@elzody
elzody requested a review from juliusknorr as a code owner July 29, 2025 22:27
@elzody elzody moved this from 🏗️ In progress to 👀 In review in 📝 Productivity team Jul 29, 2025
@elzody
elzody requested a review from blizzz July 29, 2025 22:29
@elzody
elzody force-pushed the feat/wopi-proof branch from fab2eba to cbc0cb4 Compare July 30, 2025 16:38
@elzody
elzody requested a review from a team July 30, 2025 19:22

@blizzz blizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment to double check, otherwise looking good 👍

Comment thread lib/Service/ProofKeyService.php Outdated
elzody added 2 commits August 14, 2025 11:05
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
@elzody
elzody merged commit f2fbc91 into main Aug 14, 2025
68 checks passed
@elzody
elzody deleted the feat/wopi-proof branch August 14, 2025 15:13
@github-project-automation github-project-automation Bot moved this from 👀 In review to ☑️ Done in 📝 Productivity team Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request feature: wopi host php Pull requests that update Php code tests

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants