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

Django first_run Admin Management Script Bad Practice in Non-Interactive Mode #1046

Open
3 tasks
bama4 opened this issue Oct 13, 2020 · 4 comments
Open
3 tasks

Comments

@bama4
Copy link
Contributor

bama4 commented Oct 13, 2020

Description

When the first_run django management script is executed in non-interactive mode, a username and password is automatically created for the GovReady instance.

Issues with non-interactive mode:

  • The password appears in plaintext in the terminal.
  • When the admin signs in with the auto-generated credentials, the admin is not forced to change their default password.
  • Users are allowed to register and create profiles before the admin changes the default password.

This could lead to a situation in which the default credentials to the admin account that were printed to stdout are unchanged.

Example output of running: sudo docker container exec -it govready-q first_run --non-interactive

Installing GovReady-Q in non-interactive mode...
WARNING: Use of 'host' environment paramenter deprecated. Please use 'govready-url' environment parameter in future.
INFO: ALLOWED_HOSTS ['localhost']
WARNING: Use of 'https' environment paramenter deprecated. Please use 'govready-url' environment parameter in future.
INFO: Connection scheme is 'http'.
INFO: 'SITE_ROOT_URL' set to http://localhost:8080 
WARNING: Specified PDF generator is not supported. Setting generator to 'off'.
WARNING: Specified IMG generator is not supported. Setting generator to 'off'.
Adding appname 'System-Description-Demo' from AppSource 'govready-q-files-startpack' to catalog.
Adding appname 'PTA-Demo' from AppSource 'govready-q-files-startpack' to catalog.
Adding appname 'rules-of-behavior' from AppSource 'govready-q-files-startpack' to catalog.
Adding AppSource for authoring.
Created administrator account (username: admin) with password: password
Created administrator portfolio admin
You can now login into GovReady-Q...

Risk Level
Fortify detects this issue as Privacy Violation: Critical due to the fact that passwords are being printed to stdout.
Risk level is low depending on level of access that other users have to the system running GovReady.
Printing passwords to stdout without forcing the user to create a new password upon login is more of a bad practice than a vulnerability in this case.

Goal

Plain-text passwords should not be printed to stdout in the terminal. If they are, the account associated with the account should be forced to change their password before any further action is taken on the GovReady server

The suggestion is to:

  • Prevent any user registration until the admin logs into GovReady in the case where GovReady was initialized in non-interactive mode.
  • Force the admin to change their default credentials immediately upon first login in the case where GovReady was initialized in non-interactive mode.

Other options:

  • Remove non-interactive mode entirely if not necessary for GovReady.
@bama4 bama4 changed the title Django first_run Admin Management Script Information Leak in Non-Interactive Mode Django first_run Admin Management Script Bad Practice in Non-Interactive Mode Oct 13, 2020
@bama4 bama4 added the fortify Fortify Finding label Nov 12, 2020
@bama4
Copy link
Contributor Author

bama4 commented Nov 18, 2020

Per @peterkaminski, this should be labeled as a POAM for later revisiting.

@t-s t-s self-assigned this Nov 19, 2020
@t-s
Copy link
Contributor

t-s commented Nov 19, 2020

Ok if I grab this? @bama4

@bama4
Copy link
Contributor Author

bama4 commented Nov 19, 2020

Ok if I grab this? @bama4

@t-s I would talk with @gregelin. I spoke with @peterkaminski as I mentioned above, and the thought was that this should be revisited later due to the fact that this would be a major feature added.

@t-s t-s removed their assignment Nov 19, 2020
@t-s
Copy link
Contributor

t-s commented Nov 19, 2020

@bama4 Ok thanks! I'll hold off

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

2 participants