Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

[BUG] [SECURITY] Password of emailaccount is plaintext and visible #1233

Open
MrHappy opened this issue Aug 16, 2021 · 7 comments · Fixed by paperless-ngx/paperless-ngx#103 · May be fixed by #1512
Open

[BUG] [SECURITY] Password of emailaccount is plaintext and visible #1233

MrHappy opened this issue Aug 16, 2021 · 7 comments · Fixed by paperless-ngx/paperless-ngx#103 · May be fixed by #1512

Comments

@MrHappy
Copy link

MrHappy commented Aug 16, 2021

Describe the bug
The password of the account to access the mailbox is visible in plaintext in the webinterface (and therefore also in the database)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '/admin/paperless_mail/mailaccount/1/change/'
  2. Scroll down to 'Password'
  3. See error

Expected behavior
A hidden/obscured representation (all asterisks or something)
And also stored as a hash in the database.

Screenshots
I do not think so ;)

Webserver logs

Irrelevant

Relevant information

  • Host OS of the machine running paperless: [e.g. Archlinux / Ubuntu 20.04]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 1.0.0]
  • Installation method: [docker / bare metal]
  • Any configuration changes you made in docker-compose.yml, docker-compose.env or paperless.conf.
@sbrunner
Copy link
Contributor

It can't be encoded in the database because it is used as it, not to verify a password...

@MrHappy
Copy link
Author

MrHappy commented Aug 16, 2021

Shouldn´t it be obfuscated/hidden on the site nevertheless?

@sbrunner
Copy link
Contributor

For the UI effectively, it's better to don't see it and don't send it, but in the database it's not possible to store a hash as it made for a user password.

@MrHappy
Copy link
Author

MrHappy commented Aug 16, 2021

That sounds like a good idea.

@knilde
Copy link

knilde commented Aug 24, 2021

Yes. I agree that the password should not be visable (at all).

Today I asked a friend to enter his password while setting up an instance for him.
He lost trust in the security of Paperless-ng at this moment. :-(
Common users don't understand that.

@AngellusMortis
Copy link

This should be rather easy to accomplish. You can add a "Mail Account Form" that ignores the initial value for the password. Likely also want to add a help text saying "write only" or something. Then the form would never load the password from the DB, but still let you set it.

I would also recommend encryption at rest as well using a Fernet field.

https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.form
https://django-fernet-fields.readthedocs.io/en/latest/

@knilde
Copy link

knilde commented Aug 30, 2021

You can add a "Mail Account Form" that ignores the initial value for the password.

Thanks for the hint but I'm afraid I don't have the knowledge to modify/add such a form.

On the docker image and tried to change the logo/logo-colour to see on which session I'm loged in - I could not manage :-)
Maybe I could if I knew the exact location to place a modified file into Paperless-ng...

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

Successfully merging a pull request may close this issue.

4 participants