Security: Validate session ID in NotificationReplyReceiver (#327)
* Security: Validate session ID in NotificationReplyReceiver - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. Fixes #268 * Security: Validate session ID in NotificationReplyReceiver - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine and wrapped with a 5s timeout to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. Fixes #268 * Security: Validate session ID in NotificationReplyReceiver - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine and wrapped with a 5s timeout to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. Fixes #268 * Security: Fix fake token triggering GitGuardian - Replaced high-entropy string `ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890` with obvious fake string `dummy_token_value_that_is_long_enough_to_pass_validation_123` in `ConnectViewModelTest.kt` to fix a false positive alert during GitHub Actions GitGuardian security check. Fixes #268 CI Check failure * Security: Fix fake token triggering GitGuardian and validate session ID - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine and wrapped with a 5s timeout to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. - Replaced high-entropy string `ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890` with obvious fake string `dummy_token_value_that_is_long_enough_to_pass_validation_123` in `ConnectViewModelTest.kt` to fix a false positive alert during GitHub Actions GitGuardian security check. Fixes #268 * Security: Fix fake token triggering GitGuardian and validate session ID - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine and wrapped with a 5s timeout to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. - Replaced high-entropy string `ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890` with obvious fake string `dummy_token_value_that_is_long_enough_to_pass_validation_123` in `ConnectViewModelTest.kt` to fix a false positive alert during GitHub Actions GitGuardian security check. Fixes #268 * Security: Validate session ID in NotificationReplyReceiver and fix false positive secret - Updated `ChatMessageDao.kt` to include `sessionExists` query. - Guarded `NotificationReplyReceiver.kt` `HermesWsClient.sendMessage` execution behind the `dao.sessionExists(sessionId)` check, preventing potential intent injection payloads against inactive/unknown sessions. - Moved message dispatch into DB IO coroutine and wrapped with a 5s timeout to ensure safe execution. - Added tests in `NotificationReplyReceiverTest.kt` to assert unknown sessions ignore replies properly. - Replaced high-entropy string `ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890` with obvious fake string `dummy_token_value_that_is_long_enough_to_pass_validation_123` in `ConnectViewModelTest.kt` to fix a false positive alert during GitHub Actions GitGuardian security check. Fixes #268 --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
d616c56176
commit
3605ca7537
4 files changed
+39
-9
No files matched your search
@@ -377,7 +377,7 @@ class ConnectViewModelTest {
|
||||
every { android.util.Base64.decode(any<String>(), any()) } throws IllegalArgumentException("bad base64")
|
||||
|
||||
// A string that is >= 32 chars and alphanumeric matching the raw token regex
|
||||
val validToken = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
|
||||
val validToken = "dummy_token_value_that_is_long_enough_to_pass_validation_123"
|
||||
viewModel.onPairingString(validToken)
|
||||
|
||||
val state = viewModel.uiState.value
|
||||
|
||||
Reference in new issue
Block a user