Conversation
Comment on lines
+14
to
+37
| - name: Generate Release Keystore | ||
| run: | | ||
| keytool -genkeypair -alias consoleflow -keyalg RSA -keysize 2048 -validity 10000 -keystore release.keystore -storepass consoleflow123 -keypass consoleflow123 -dname "CN=consoleflow, OU=App, O=consoleflow, L=Unknown, ST=Unknown, C=US" | ||
|
|
||
| echo "" | ||
| echo "================================================" | ||
| echo " COPY THESE VALUES TO GITHUB SECRETS" | ||
| echo "================================================" | ||
| echo "" | ||
| echo "Secret name: KEYSTORE_B64" | ||
| echo "Secret value (copy everything between the lines):" | ||
| echo "----" | ||
| base64 -w 0 release.keystore | ||
| echo "" | ||
| echo "----" | ||
| echo "" | ||
| echo "Secret name: KEY_ALIAS" | ||
| echo "Secret value: consoleflow" | ||
| echo "" | ||
| echo "Secret name: KEYSTORE_PASSWORD" | ||
| echo "Secret value: consoleflow123" | ||
| echo "" | ||
| echo "Secret name: KEY_PASSWORD" | ||
| echo "Secret value: consoleflow123" |
There was a problem hiding this comment.
1. Keystore leaked in logs 🐞 Bug ⛨ Security
The new generate-keystore workflow prints the base64-encoded release keystore and its hardcoded passwords to the GitHub Actions logs, exposing the signing private key to anyone with log access. This can enable malicious actors to sign and distribute counterfeit “official” releases.
Agent Prompt
## Issue description
The workflow `.github/workflows/generate-keystore.yml` prints the release keystore (`base64 -w 0 release.keystore`) and hardcoded passwords to stdout, which ends up in CI logs and leaks signing material.
## Issue Context
Release signing keys must never be printed or stored in logs. Even for a manually triggered workflow, logs are typically accessible to many users/roles and may be retained.
## Fix Focus Areas
- Remove or heavily restrict this workflow; do not output keystore/passwords to logs.
- If you must generate in CI, upload the keystore as a short-lived artifact and protect the environment with required reviewers; do not echo secrets.
- Use randomly generated passwords (or inputs) rather than hardcoded values.
## Fix Focus Areas (code references)
- .github/workflows/generate-keystore.yml[14-37]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Comment on lines
+34
to
+47
| private val executor = Executors.newFixedThreadPool(3) | ||
| private val activeCount = AtomicInteger(0) | ||
| private val notifIdGen = AtomicInteger(NOTIF_BASE) | ||
|
|
||
| private val notifManager: NotificationManager by lazy { | ||
| getSystemService(NotificationManager::class.java)!! | ||
| } | ||
|
|
||
| private val okClient = OkHttpClient.Builder() | ||
| .connectTimeout(30, TimeUnit.SECONDS) | ||
| .readTimeout(0, TimeUnit.SECONDS) | ||
| .followRedirects(true) | ||
| .followSslRedirects(true) | ||
| .build() |
There was a problem hiding this comment.
4. Download cancellation not robust 🐞 Bug ☼ Reliability
DownloadService configures OkHttp with an infinite read timeout and cancellation only updates tracker state, so a stalled socket read may block indefinitely and cannot be cancelled promptly. The service also stops without shutting down its thread pool, which can leave idle threads alive after stopSelf().
Agent Prompt
## Issue description
The download loop can become effectively non-cancellable when network reads stall because:
- OkHttp is configured with `readTimeout(0, ...)` (infinite).
- Cancel requests only update `DownloadTracker` state; there is no `Call.cancel()` path.
Also, the service uses a fixed thread pool that is never shut down on service stop.
## Issue Context
If `input.read()` blocks waiting for network data, your loop cannot check the cancelled state until the read returns. Proper cancellation typically requires tracking `Call` objects and cancelling them.
## Fix Focus Areas
- Set finite `readTimeout` and/or `callTimeout` for downloads.
- Store active `Call` per download id (e.g., `ConcurrentHashMap<Int, Call>`) and call `cancel()` in `handleCancel`.
- Override `onDestroy()` and/or update `stopWhenIdle()` to `executor.shutdownNow()` and cancel any active calls.
- Consider `START_NOT_STICKY` if you do not support restart-resume.
## Fix Focus Areas (code references)
- app/src/main/java/space/karrarnazim/ConsoleFlow/download/DownloadService.kt[34-47]
- app/src/main/java/space/karrarnazim/ConsoleFlow/download/DownloadService.kt[418-424]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.