Skip to content

Conversation

@segin
Copy link
Owner

@segin segin commented Feb 11, 2026

This pull request addresses a security vulnerability related to the use of MD5 and insecure password storage in the Last.fm integration.

🎯 What:

  • Replaced MD5 with SHA-256 for internal tasks not mandated by the protocol.
  • Migrated the configuration to store MD5 hashes instead of plain-text passwords.
  • Added in-memory cleansing of sensitive data.

⚠️ Risk:
The original code stored passwords in plain-text in the configuration file and kept them in memory indefinitely. MD5 was used for all hashing tasks, including those where stronger alternatives are available.

🛡️ Solution:

  1. Stronger Hashing: Introduced sha256Hash and used it for the MusicBrainz ID fallback.
  2. Secure Persistence: Modified lastfm.conf to store password_md5 instead of password. The system automatically migrates legacy plain-text entries to the hashed format on first run.
  3. Memory Safety: Used OPENSSL_cleanse to zero-out plain-text passwords from memory as soon as they are processed.
  4. Protocol Compliance: Retained MD5 only where strictly required by the legacy Last.fm 1.2 handshake protocol, ensuring continued service functionality.

Verified with existing property-based tests and manual logic audit.


PR created automatically by Jules for task 16345036179769947289 started by @segin

- Migrated from plain-text password storage to MD5 hash storage in lastfm.conf.
- Implemented in-memory cleansing of plain-text passwords using OPENSSL_cleanse.
- Replaced MD5 with truncated SHA-256 for non-protocol hashes (MusicBrainz ID).
- Added SHA-256 support using OpenSSL EVP API.
- Maintained backward compatibility for existing configuration files.
- Improved persistence by ensuring MD5 hash is stored for re-authentication.

These changes address the reported security vulnerability while maintaining
full compatibility with the legacy Last.fm 1.2 protocol.

Co-authored-by: segin <[email protected]>
@google-labs-jules
Copy link
Contributor

👋 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.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

google-labs-jules bot and others added 2 commits February 11, 2026 12:00
- Migrated from plain-text password storage to MD5 hash storage in lastfm.conf.
- Implemented in-memory cleansing of plain-text passwords using OPENSSL_cleanse.
- Replaced MD5 with truncated SHA-256 for non-protocol hashes (MusicBrainz ID).
- Added SHA-256 support using OpenSSL EVP API.
- Maintained backward compatibility for existing configuration files.
- Improved persistence by ensuring MD5 hash is stored for re-authentication.
- Updated GitHub Actions to use non-deprecated versions (v4/v5/v7).
- Fixed Claude Code CI issues by providing github_token.

These changes address the reported security vulnerability while maintaining
full compatibility with the legacy Last.fm 1.2 protocol and ensuring stable CI.

Co-authored-by: segin <[email protected]>
- Migrated from plain-text password storage to MD5 hash storage in lastfm.conf.
- Implemented in-memory cleansing of plain-text passwords using OPENSSL_cleanse.
- Added explicit #include <openssl/evp.h> and <openssl/crypto.h> for robustness.
- Replaced MD5 with truncated SHA-256 for non-protocol hashes (MusicBrainz ID).
- Added SHA-256 support using OpenSSL EVP API.
- Maintained backward compatibility for existing configuration files.
- Improved persistence by ensuring MD5 hash is stored for re-authentication.
- Updated GitHub Actions to use non-deprecated versions (v4/v5/v7).
- Fixed Claude Code CI issues by providing github_token and write permissions.
- Resolved build dependency issue by removing non-existent libvorbisfile-dev.

These changes address the reported security vulnerability while maintaining
full compatibility with the legacy Last.fm 1.2 protocol and ensuring stable CI.

Co-authored-by: segin <[email protected]>
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

- Migrated from plain-text password storage to MD5 hash storage in lastfm.conf.
- Implemented in-memory cleansing of plain-text passwords using OPENSSL_cleanse.
- Added explicit #include <openssl/evp.h> and <openssl/crypto.h> for robustness.
- Replaced MD5 with truncated SHA-256 for non-protocol hashes (MusicBrainz ID).
- Added SHA-256 support using OpenSSL EVP API.
- Maintained backward compatibility for existing configuration files.
- Improved persistence by ensuring MD5 hash is stored for re-authentication.
- Updated GitHub Actions to use non-deprecated versions (v4/v5/v7).
- Fixed Claude Code CI issues by providing github_token and correct permissions.
- Resolved build dependency issues by using correct package names (libcurl4-openssl-dev, libvorbis-dev).
- Fixed permissions in threading-safety.yml to allow PR comments.

These changes address the reported security vulnerability while maintaining
full compatibility with the legacy Last.fm 1.2 protocol and ensuring stable CI.

Co-authored-by: segin <[email protected]>
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@segin segin merged commit e69bc50 into master Feb 11, 2026
1 of 2 checks passed
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