Kunzisoft / Kunzisoft/KeePassDX

MasterCredential Plain text

Open
#2,485 1 comment 1 reaction 0 assignees View on GitHub
security
Dominant language
Kotlin
Stars
7.3k
Forks
401
Avg merge
2d 10h
Merged PRs (30d)
1

Description

### Checks

- [x] I have read the Wiki, searched the open issues, and still think this is a new bug.

### Explain the problem clearly and succinctly:

- Password stored as String instead of CharArray

**File:** `database/src/main/java/com/kunzisoft/keepass/database/element/MasterCredential.kt:46`

The master password is stored and passed as `String?` throughout the codebase. Java/Kotlin `String` objects are immutable and remain in heap memory until GC, making it impossible to proactively clear password data. Security best practice recommends using `CharArray` and calling `Arrays.fill(charArray, '\u0000')` after use.

- Parcel serialization transmits password in plaintext

**File:** `database/src/main/java/com/kunzisoft/keepass/database/element/MasterCredential.kt:57-59`

`writeToParcel()` writes the password as a plaintext string. Parcel native buffers are not automatically cleared, and the password may persist in system memory.

- OtpModel transmitted via Intent without cleanup

File: app/src/main/java/com/kunzisoft/keepass/services/ClipboardEntryNotificationService.kt:61-62

OtpModel containing OTP secrets is passed via Intent extras but never cleaned up with removeExtra().

### Describe what you expected to happen:

_No response_

### KeePassDX version:

4.3.3

### Build:

Free, Libre

### Database version:

_No response_

### File provider (`content://` URI)

_No response_

### Android version:

_No response_

### Android device:

_No response_

### Additional context:

Linked to https://github.com/Kunzisoft/KeePassDX/issues/2480

Contributor guide

Open the contributing guide

Research direction

Start with database/src/main/java/com/kunzisoft/keepass/database/element/MasterCredential.kt, especially the credential field and writeToParcel(), then inspect app/src/main/java/com/kunzisoft/keepass/services/ClipboardEntryNotificationService.kt. Trace how MasterCredential and OtpModel are passed and stored. Done means the reported plaintext password and uncleaned OTP transfer paths are addressed and the relevant Android behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.