Skip to content

🔒 Fix Hardcoded Credentials in Preferences#97

Open
G30RG3-GJ wants to merge 1 commit intomasterfrom
security/fix-hardcoded-credentials-3405941572062292418
Open

🔒 Fix Hardcoded Credentials in Preferences#97
G30RG3-GJ wants to merge 1 commit intomasterfrom
security/fix-hardcoded-credentials-3405941572062292418

Conversation

@G30RG3-GJ
Copy link
Owner

This PR addresses the security vulnerability of hardcoded default credentials.

Changes:

  1. Preferences.java: Removed username = "admin" and setPassword("admin") from the constructor.
  2. LoginController.java: Added logic to check if Preferences has a username set. If not, it enters a "Setup Mode" where the user can create an admin account. The new credentials are hashed and saved to config.txt.
  3. login.fxml: Added fx:id to the login button and a new Label to display status messages (e.g., "First Run").
  4. Tests: Added PreferencesTest.java to verify that Preferences initializes with null credentials and that password hashing works as expected. Added AlertMaker stub to facilitate testing in an environment without JavaFX.

PR created automatically by Jules for task 3405941572062292418 started by @G30RG3-GJ

- Removed default "admin" username and password from Preferences constructor.
- Modified LoginController to detect missing credentials and prompt for admin account creation.
- Updated login.fxml with status label and fx:id for login button.
- Added PreferencesTest to verify removal of default credentials and password hashing logic.
- Added AlertMaker stub to allow compilation of Preferences in headless environment.

Co-authored-by: G30RG3-GJ <203693057+G30RG3-GJ@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant