-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
[v1.0.0b] [Task] - Improve Application Security #1197
Comments
Why is there a max. password length?
Why only 2FA and not MFA? My ideas:
|
To prevent denial of service attacks since password fields are publicly exposed. Someone could spam the server with excessively long passwords and block compute space on the server. 128 seemed like a reasonable limit for any password, even generated by a password manager. I want to make it clear that this has NOTHING to do with storage requirements.
Because I'm only one man. 2FA is a reachable goal. If someone wants to implement MFA by all means.
I don't think either of these can be done without external services, which is why I didn't list them.
We use the well regarded passlib library to handle hashing and verification.
Maybe this is something we could add. I have a feeling implementing this would cause problems with migrations if someone wanted to move a system they could easily forget to move their pepper or something.
Luckily we just treat the HTML and JSON scraped as text so the attack vector here should be pretty small. I'm sure this is an area of concern, but this one's pretty low on the list. Thanks! |
I don't think that is a huge problem, but certainly something to think about. Maybe this article can be used as a useful resource. ;) |
Can you remove the inline styling as well? It's the only part of the Content-Security-Policy header that currently needs to have hash-based exceptions. Here is a Mozilla site that can scan a site for http vulnerabilities and explains them https://observatory.mozilla.org/ |
That's not something I'm going to work on given the scope of the issues, there's more critical security improvements that my time is better spent on. Willing to accept a PR on this is someone wants to go through all the components, but I suspect it will be a pretty time consuming task. |
Don't think it will wind up being too bad, only had 6 that I had to add hashes for. I brought it up since security was being discussed. I'll give it a stab and see if I can resolve them. Will be a good opportunity to look through code anyways. |
Suggestion for authentication I haven't looked into the implementation of mealie's authentication system yet, so might be a large lift. If this is a direction you would like to go, I can help/discuss it. I joined the discord channel too, so hopefully, I can start contributing. |
There have been dozens of requests for this over the last two years and no one has offered to do any of the work around it. I'm not opposed to the feature, but it's not something I would use or am particularly interested in. I'm happy to support the efforts of someone who wants to take this on and write a robust integration with adequate tests. If you or anyone else wants to tackle SSO in some form I suggest you follow the feature requests form and lay out a clear plan on how it would be implemented. |
Some input regarding Docker security:
I commonly drop all capabilities for all containers and then check what operations fail and subsequently add the capabilities required for the application to work properly. With mealie I ended up with the following capabilities:
Note that the granted capabilities are all included in the default capability set used by Docker. Therefore, we improve security even if the The |
Not sure if you’ve had any progress yet, but I’d love to help test OIDC. I am currently moving from Keycloak to Authentik and could try out both. |
To avoid having to tackle the more complex OpenID Connect stuff, reverse proxy/header authentication could be used instead / as a stop gap. Basically you run the application behind a reverse proxy, and the proxy authenticates the user and adds |
@Drumstickx would you mind sharing how you got mealie to run rootless? I tried using PUID/PGID or adding the user directive in my docker compose but I can't get the container to start. |
I use a setup where Docker is running without root privileges in the userspace. I guess you are trying to run "rootless" within the mealie container? I have not yet tried that. |
The initial list looks great! One thing I would add to it is avoiding the use of a default admin password, maybe making it a required environment variable or requesting it on first startup. |
The documentation says that UID and GID can be set via env vars. Is this not the case? I'm running into permission issues when running the pass word reset script in the container and I'm wondering if it's related to this. |
What are the issues? |
@boc-the-git I appreciate the quick response. I'll submit a bug ticket and link it to this thread via an issue mention. |
@boc-the-git While writing up the bug ticket I was able to solve my issue. In my case, the bind mount where the postgres data is stored had it's ownership overwritten by Open Media Vault on the server where the files live. I'm still trying to track down why OMV is doing this. I suspect it has something to do with NFS or SMB. I run Mealie in Docker Compose. The Mealie container is run with user/group 1000:1000, but the postgres container is run as root. The password reset script is run by exec-ing into the Mealie container as root and running a python script that needs access to the db files bound to the postgres container. So i set the ownership of the postgres bind mount folder to root. postgres:
...
volumes:
- /somepath/mealie_db:/var/lib/postgresql/data
container_name: postgres I ran the following on the host:
Restarted the containers in the stack, then was able to run the password reset script without permission issues. Sorry for cluttering this thread. |
Glad you solved it @patrick-motard, and thanks for providing an explanation of how in case it helps someone in future. |
What is the problem this task addresses?
There are several areas that Mealie could improve overall security and practices
User Related
Docker Runtime
General
Proposed/Possible Solution(s)?
The text was updated successfully, but these errors were encountered: