Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text app and Android Direct Editing permit creating data unencrypted within encrypted folders #5168

Open
cyphunk opened this issue Mar 19, 2020 · 12 comments

Comments

@cyphunk
Copy link

cyphunk commented Mar 19, 2020

I have the text app enabled. I create a new text file ("enc.md") within an encrypted folder. When I edit this file the data shows up in plain text on the server. I'm reporting this issue here rather than in the "text" app because the e2e encryption system should not permit storing of unencrypted data in encrypted folders, or should not allow apps to store data in them, or should at least note which files are actually encrypted

Steps to reproduce

  • on android nextcloud app (3.10.1)
    • create new folder "Encrypted"
    • in files view change folder properties to encrypted
    • open Encrypted folder
    • press "+" and choose to create new text document "enc.md"
    • add some text to document
    • close document
  • on server: cat data/user/files/Encrypted/enc.md
    • observe that plaintext data is shown

Expected behaviour

Any data stored in encrypted folder should appear encrypted on the server hard disk

Actual behaviour

cat data/_user_/files/Encrypted/enc.md shows plaintext data

Server configuration

Operating system: ubuntu 18.04

Web server: nginx 1.14.0-0ubuntu1.7

Database: whatever is in the docker hub nextcloud:18.0.2-fpm-alpine

PHP version: whatever is in the docker hub nextcloud:18.0.2-fpm-alpine

Nextcloud version: docker hub nextcloud:18.0.2-fpm-alpine

Updated from an older Nextcloud/ownCloud or fresh install: fresh

Where did you install Nextcloud from: docker hub nextcloud:18.0.2-fpm-alpine

Android app version: 3.10.1

@georgehrke
Copy link
Member

@juliushaertl

@georgehrke
Copy link
Member

@cyphunk Can you please use the issue template: https://github.com/nextcloud/server/blob/master/.github/ISSUE_TEMPLATE/Bug_report.md

open Encrypted folder

This step should not be possible. You should not be able to open encrypted folders in the web ui.

@cyphunk
Copy link
Author

cyphunk commented Mar 19, 2020

will correct to this format. BTW, it wasn't accessible in webui. that still remained true. enc.md file in encrypted folder was only accessible in android app. still, data on server stored unencrypted

@georgehrke
Copy link
Member

What version of the Android app are you using?

@cyphunk
Copy link
Author

cyphunk commented Mar 19, 2020

3.10.1

@juliusknorr
Copy link
Member

There seem to be actually two issues here:

  • The text app should just not work with e2ee
  • The mobile apps should not allow direct editing and creating files inside of e2ee folders

cc @tobiasKaminsky @marinofaggiana

@juliusknorr juliusknorr self-assigned this Mar 19, 2020
@cyphunk
Copy link
Author

cyphunk commented Mar 19, 2020

hmm. can I submit this as a bug bounty? :)

@georgehrke
Copy link
Member

  • The text app should just not work with e2ee

@juliushaertl Any update here? :)

@juliusknorr
Copy link
Member

@georgehrke Do you have any idea how i could check if a file or the parent folder is encrypted with e2e but not with SSE (since there the encrypted flag in the filecache would also be set)

@juliusknorr
Copy link
Member

I didn't check in detail yet, but I would expect this could also cause issues when SSE and E2E are used in parallel:
https://github.com/nextcloud/end_to_end_encryption/blob/64d372ae558b894f667a280fb4e35343f760de3e/lib/EncryptionManager.php#L100

@juliusknorr juliusknorr removed their assignment Oct 14, 2022
@joshtrichards
Copy link
Member

joshtrichards commented Nov 21, 2023

@joshtrichards joshtrichards changed the title Certain apps store data unencrypted within encrypted folders Text app and Android Direct Editing permit creating data unencrypted within encrypted folders Dec 26, 2023
@joshtrichards joshtrichards transferred this issue from nextcloud/end_to_end_encryption Dec 26, 2023
@ph00lt0
Copy link

ph00lt0 commented Jan 5, 2024

You are completely addressing this in the wrong way @joshtrichards. I really have to comment this. Not because I believe it will help now. But you really need better architects and management at Nextcloud.

This is yet another security flaw in e2ee offering of Nextcloud. A folder designated for e2ee files should never allow to store anything but e2ee encrypted files thus should only allow writes and reads via an service for this. It should by design not be possible to write or read from this folder in a different way.
This issue would probably have never occurred when propper sanitization was taking place in apps and it's apis were tested with unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants