Mitigate VIA keylogger security issues (#25414)

Co-authored-by: Nick Brassel <nick@tzarc.org>
This commit is contained in:
Joel Challis 2025-06-29 02:29:33 +01:00 committed by GitHub
parent 6347d18a2d
commit 711b109246
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -22,6 +22,10 @@
# error "DYNAMIC_KEYMAP_ENABLE is not enabled"
#endif
#ifdef VIA_INSECURE
# pragma message "VIA_INSECURE is enabled - firmware is susceptible to keyloggers"
#endif
#include "via.h"
#include "raw_hid.h"
@ -318,7 +322,11 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
uint8_t rows = 28 / ((MATRIX_COLS + 7) / 8);
uint8_t i = 2;
for (uint8_t row = 0; row < rows && row + offset < MATRIX_ROWS; row++) {
#ifdef VIA_INSECURE
matrix_row_t value = matrix_get_row(row + offset);
#else
matrix_row_t value = 0;
#endif
#if (MATRIX_COLS > 24)
command_data[i++] = (value >> 24) & 0xFF;
#endif