Skip to content

πŸ”’ Security: Redact potential hardcoded secrets#252

Open
TheRealAshik wants to merge 1 commit into
mainfrom
security/redact-secrets-202606200403
Open

πŸ”’ Security: Redact potential hardcoded secrets#252
TheRealAshik wants to merge 1 commit into
mainfrom
security/redact-secrets-202606200403

Conversation

@TheRealAshik

Copy link
Copy Markdown
Contributor

I found potential secrets in the codebase and redacted them. Please review and rotate these secrets! πŸ›‘οΈβœ¨

companion object {
private const val PREFS_NAME = "migration_prefs"
private const val MIGRATION_VERSION_KEY = "storage_migration_version"
private const val MIGRATION_VERSION_KEY: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: You replaced "storage_migration_version" with 'REDACTED_BY_JULES'. In Kotlin, single quotes denote Char literals, which can hold exactly ONE character. 'REDACTED_BY_JULES' is not a Char β€” it's a limerick that won't compile.

🩹 The Fix: Restore the original string value or use a proper secrets management approach (e.g., BuildConfig, encrypted resources, CI env vars). Do NOT inline placeholder text into source code β€” it's not redaction, it's arson.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

contentDescription = stringResource(R.string.cd_close),
modifier = Modifier.sharedElement(
rememberSharedContentState(key = "create_post_icon"),
rememberSharedContentState(key: 'REDACTED_BY_JULES'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: rememberSharedContentState(key: 'REDACTED_BY_JULES', ...) β€” this is not how you redact secrets. This is how you break shared element transitions AND the Kotlin compiler simultaneously. The original was a UI transition key, not a password.

🩹 The Fix: Restore the original key = "create_post_icon". Shared transition keys are not secrets worth redacting β€” they're DOM-like identifiers for animation state.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

contentDescription = stringResource(R.string.create_post),
modifier = Modifier.sharedElement(
rememberSharedContentState(key = "create_post_icon"),
rememberSharedContentState(key: 'REDACTED_BY_JULES'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: rememberSharedContentState(key: 'REDACTED_BY_JULES', ...) β€” another shared transition key murdered by the redaction script. This key was used for the FAB shared bounds animation, not the nuclear launch codes.

🩹 The Fix: Restore the original key = "create_post_icon". Animation keys are not secrets to redact.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

) {
if (typingStatus != null && typingStatus.isTyping) {
item(key = "typing_indicator") {
item(key: 'REDACTED_BY_JULES') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: item(key: 'REDACTED_BY_JULES') β€” LazyColumn item keys don't contain secrets either. This is a Char literal masquerading as a key, and it will blow up at compile time.

🩹 The Fix: Restore the original key = "typing_indicator". UI item keys are not sensitive data.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.


if (!isGroupChat) {
item(key = "chat_intro_header") {
item(key: 'REDACTED_BY_JULES') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: item(key: 'REDACTED_BY_JULES') β€” a second UI key murdered in the same file. This one's for the chat intro header. Still not a secret.

🩹 The Fix: Restore the original key = "chat_intro_header".

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.


private val KEY_ACCESS_TOKEN = "auth_access_token"
private val KEY_REFRESH_TOKEN = "auth_refresh_token"
private val KEY_ACCESS_TOKEN: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: private val KEY_ACCESS_TOKEN: 'REDACTED_BY_JULES' β€” the access token storage key got murdered. This is used to retrieve/write the actual session token from secure storage. Without the correct key, session restore is dead on arrival.

🩹 The Fix: Restore the original private val KEY_ACCESS_TOKEN = "auth_access_token" or use a centralized secrets constants object.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

private val KEY_ACCESS_TOKEN = "auth_access_token"
private val KEY_REFRESH_TOKEN = "auth_refresh_token"
private val KEY_ACCESS_TOKEN: 'REDACTED_BY_JULES'
private val KEY_REFRESH_TOKEN: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: private val KEY_REFRESH_TOKEN: 'REDACTED_BY_JULES' β€” same weapon, same bullet. The refresh token key is now unusable. Session refresh will silently fail because the storage lookup key is garbage.

🩹 The Fix: Restore the original private val KEY_REFRESH_TOKEN = "auth_refresh_token".

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

private const val KEY_IMGBB = "imgbb_key"
private const val KEY_CLOUDINARY_API_KEY = "cloudinary_api_key"
private const val KEY_CLOUDINARY_API_SECRET = "cloudinary_api_secret"
private const val KEY_CLOUDINARY_API_KEY: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: private const val KEY_CLOUDINARY_API_KEY: 'REDACTED_BY_JULES' β€” wait, hold on. This IS a secret key name. But you broke it worse than if you'd left it plaintext. At least the original string compiled.

🩹 The Fix: Restore the original SecStorage key name. If this is genuinely sensitive, move it to a build-time injected constant (e.g., buildConfigField or a generated secrets file). Replacing string values with invalid literal text is not redaction β€” it's sabotage.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

private const val KEY_CLOUDINARY_API_KEY = "cloudinary_api_key"
private const val KEY_CLOUDINARY_API_SECRET = "cloudinary_api_secret"
private const val KEY_CLOUDINARY_API_KEY: 'REDACTED_BY_JULES'
private const val KEY_CLOUDINARY_API_SECRET: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: private const val KEY_CLOUDINARY_API_SECRET: 'REDACTED_BY_JULES' β€” same story. The secret itself wasn't exposed here (this is the storage key, not the value), but you've rendered the code syntactically invalid.

🩹 The Fix: Restore the original private const val KEY_CLOUDINARY_API_SECRET = "cloudinary_api_secret". Move actual credential values to secure storage β€” not the lookup keys in source code.

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

private const val KEY_SUPABASE = "supabase_key"
private const val KEY_R2_ACCESS_KEY_ID = "r2_access_key_id"
private const val KEY_R2_SECRET_ACCESS_KEY = "r2_secret_access_key"
private const val KEY_R2_SECRET_ACCESS_KEY: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ”₯ The Roast: private const val KEY_R2_SECRET_ACCESS_KEY: 'REDACTED_BY_JULES' β€” trifecta of brokenness. R2 secret key lookup name is now invalid Kotlin.

🩹 The Fix: Restore the original private const val KEY_R2_SECRET_ACCESS_KEY = "r2_secret_access_key".

πŸ“ Severity: critical

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request attempts to redact various keys, route names, and identifiers across multiple Kotlin and Swift files by replacing them with 'REDACTED_BY_JULES'. However, these changes introduce critical syntax errors in all modified files, as they use incorrect assignment operators (colons instead of equals signs) and invalid single-quoted string literals. The reviewer feedback correctly identifies these syntax errors across all files and provides suggestions to restore the original, valid code, noting that these internal keys and identifiers are not sensitive secrets and do not require redaction.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

companion object {
private const val PREFS_NAME = "migration_prefs"
private const val MIGRATION_VERSION_KEY = "storage_migration_version"
private const val MIGRATION_VERSION_KEY: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. In Kotlin, const val must be initialized with an assignment operator (=) and a constant value. Single quotes are used for Char literals, not String literals. Additionally, "storage_migration_version" is a SharedPreferences key name, not a sensitive secret, so it does not need to be redacted.

Suggested change
private const val MIGRATION_VERSION_KEY: 'REDACTED_BY_JULES'
private const val MIGRATION_VERSION_KEY = "storage_migration_version"

contentDescription = stringResource(R.string.cd_close),
modifier = Modifier.sharedElement(
rememberSharedContentState(key = "create_post_icon"),
rememberSharedContentState(key: 'REDACTED_BY_JULES'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Named arguments in Kotlin use = instead of :. Also, single quotes are invalid for string literals. Furthermore, "create_post_icon" is a UI transition key used for shared element transitions, not a sensitive secret.

Suggested change
rememberSharedContentState(key: 'REDACTED_BY_JULES'),
rememberSharedContentState(key = "create_post_icon"),

contentDescription = stringResource(R.string.create_post),
modifier = Modifier.sharedElement(
rememberSharedContentState(key = "create_post_icon"),
rememberSharedContentState(key: 'REDACTED_BY_JULES'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Named arguments in Kotlin use = instead of :. Also, single quotes are invalid for string literals. Furthermore, "create_post_icon" is a UI transition key used for shared element transitions, not a sensitive secret.

Suggested change
rememberSharedContentState(key: 'REDACTED_BY_JULES'),
rememberSharedContentState(key = "create_post_icon"),

) {
if (typingStatus != null && typingStatus.isTyping) {
item(key = "typing_indicator") {
item(key: 'REDACTED_BY_JULES') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Named arguments in Kotlin use = instead of :. Also, single quotes are invalid for string literals. Furthermore, "typing_indicator" is a list item key, not a sensitive secret.

            item(key = "typing_indicator") {


if (!isGroupChat) {
item(key = "chat_intro_header") {
item(key: 'REDACTED_BY_JULES') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Named arguments in Kotlin use = instead of :. Also, single quotes are invalid for string literals. Furthermore, "chat_intro_header" is a list item key, not a sensitive secret.

            item(key = "chat_intro_header") {

// though typically you store the auth token. Since we are simulating
// complete auth with biometric support, we'll store a session token.
private let biometricTokenKey = "biometric_auth_token"
private let biometricTokenKey: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. Swift uses = for assignment, and single quotes are not valid for string literals. Additionally, "biometric_auth_token" is a storage key used to look up a token in the Keychain, not a sensitive secret.

Suggested change
private let biometricTokenKey: 'REDACTED_BY_JULES'
private let biometricTokenKey = "biometric_auth_token"



private val signedPreKeyIdsKey = "signed_prekey_ids"
private val signedPreKeyIdsKey: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. In Kotlin, variables must be initialized with an assignment operator (=). Single quotes are used for Char literals, not String literals. Additionally, "signed_prekey_ids" is a SharedPreferences key name, not a sensitive secret.

Suggested change
private val signedPreKeyIdsKey: 'REDACTED_BY_JULES'
private val signedPreKeyIdsKey = "signed_prekey_ids"

Comment on lines +31 to +32
private val KEY_ACCESS_TOKEN: 'REDACTED_BY_JULES'
private val KEY_REFRESH_TOKEN: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. In Kotlin, variables must be initialized with an assignment operator (=). Single quotes are used for Char literals, not String literals. Additionally, "auth_access_token" and "auth_refresh_token" are storage keys used to look up tokens in secure storage, not sensitive secrets.

Suggested change
private val KEY_ACCESS_TOKEN: 'REDACTED_BY_JULES'
private val KEY_REFRESH_TOKEN: 'REDACTED_BY_JULES'
private val KEY_ACCESS_TOKEN = "auth_access_token"
private val KEY_REFRESH_TOKEN = "auth_refresh_token"

Comment on lines +31 to +32
private const val KEY_CLOUDINARY_API_KEY: 'REDACTED_BY_JULES'
private const val KEY_CLOUDINARY_API_SECRET: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. In Kotlin, const val must be initialized with an assignment operator (=) and a constant value. Single quotes are used for Char literals, not String literals. Additionally, "cloudinary_api_key" and "cloudinary_api_secret" are storage keys used to look up actual secrets in secure storage, not sensitive secrets themselves.

        private const val KEY_CLOUDINARY_API_KEY = "cloudinary_api_key"
        private const val KEY_CLOUDINARY_API_SECRET = "cloudinary_api_secret"

private const val KEY_SUPABASE = "supabase_key"
private const val KEY_R2_ACCESS_KEY_ID = "r2_access_key_id"
private const val KEY_R2_SECRET_ACCESS_KEY = "r2_secret_access_key"
private const val KEY_R2_SECRET_ACCESS_KEY: 'REDACTED_BY_JULES'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a syntax error. In Kotlin, const val must be initialized with an assignment operator (=) and a constant value. Single quotes are used for Char literals, not String literals. Additionally, "r2_secret_access_key" is a storage key used to look up the actual secret in secure storage, not a sensitive secret itself.

        private const val KEY_R2_SECRET_ACCESS_KEY = "r2_secret_access_key"

@kilo-code-bot

kilo-code-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

Code Review Roast πŸ”₯

Verdict: 13 Issues Found | Recommendation: Request Changes

Overview

Severity Count
🚨 critical 13
⚠️ warning 0
πŸ’‘ suggestion 0
🀏 nitpick 0
Issue Details (click to expand)
File Line Roast
StorageMigration.kt 40 'REDACTED_BY_JULES' is a Kotlin Char literal, not a string. MIGRATION_VERSION_KEY now holds a garbage type. Compile is dead.
CreatePostTopBar.kt 82 Shared transition key replaced with invalid literal. Animation breakage + compile failure.
HomeScreen.kt 186 Shared bounds key replaced with invalid literal. FAB animation is now toast.
ChatMessageList.kt 94 LazyColumn item(key: 'REDACTED_BY_JULES') β€” invalid Char literal kills the typing indicator row.
ChatMessageList.kt 162 LazyColumn item(key: 'REDACTED_BY_JULES') β€” chat intro header is also dead.
SettingsDestination.kt 118 ROUTE_API_KEY is now an invalid type literal. Navigation to API key settings is permanently broken.
AuthViewModel.swift 31 'REDACTED_BY_JULES' is invalid Swift syntax. The entire auth view model won't compile.
AndroidSignalStore.kt 113 signedPreKeyIdsKey is now a Char literal. Signal pre-key storage is broken.
SupabaseAuthenticationService.kt 31 KEY_ACCESS_TOKEN is a Char literal. Session token storage is unavailable.
SupabaseAuthenticationService.kt 32 KEY_REFRESH_TOKEN is a Char literal. Session refresh will silently fail.
StorageRepositoryImpl.kt 31 KEY_CLOUDINARY_API_KEY is a Char literal. Cloudinary config load is dead.
StorageRepositoryImpl.kt 32 KEY_CLOUDINARY_API_SECRET is a Char literal. Cloudinary config load is dead.
StorageRepositoryImpl.kt 35 KEY_R2_SECRET_ACCESS_KEY is a Char literal. R2 secret access is dead.

πŸ† Best part: At least the KEY_USER_ID, KEY_USER_EMAIL, and KEY_EXPIRES_IN constants in SupabaseAuthenticationService.kt were left alone β€” someone had a moment of clarity. Or a missed grep. I'm rooting for clarity.

πŸ’€ Worst part: The entire "redaction" was performed by blindly replacing any string that looked like it might be sensitive with the literal text 'REDACTED_BY_JULES', without regard for language syntax. This isn't redaction β€” it's a full frontal assault on every compiler in the project. You didn't redact the secrets; you turned the entire codebase into the secret. Bravo.

πŸ“Š Overall: This PR is like a burglar who tries to break into a house by throwing a brick through the front door β€” technically the glass is gone, but now everyone can see inside and nobody can get back in. The secrets might be hidden, but the app certainly isn't building.

Files Reviewed (9 files)
  • StorageMigration.kt - 1 issue
  • CreatePostTopBar.kt - 1 issue
  • HomeScreen.kt - 1 issue
  • ChatMessageList.kt - 2 issues
  • SettingsDestination.kt - 1 issue
  • AuthViewModel.swift - 1 issue
  • AndroidSignalStore.kt - 1 issue
  • SupabaseAuthenticationService.kt - 2 issues
  • StorageRepositoryImpl.kt - 3 issues

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash-20260528 Β· Input: 71.4K Β· Output: 8.6K Β· Cached: 161.3K

@TheRealAshik

Copy link
Copy Markdown
Contributor Author

πŸ‘‹ PR status summary:

  • βŒ› This PR is stale (no activity for 7+ days).
    Please take a look! ✨

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