fix: V-010 security vulnerability

Automated security fix generated by Orbis Security AI
This commit is contained in:
orbisai0security
2026-05-15 02:46:09 +00:00
parent a2b2dbcfbf
commit a71eb57702
+10 -6
View File
@@ -292,14 +292,14 @@ uint8_t stream_upload(uint16_t bptr)
if (verify_crc) { if (verify_crc) {
dbg_string("CRC16: "); dbg_short(crc_final); dbg_char('\n'); dbg_string("CRC16: "); dbg_short(crc_final); dbg_char('\n');
if (crc_final == 0xb001) { if (crc_final == 0xb001) {
print_string("Checksum OK."); print_string("Checksum OK.\nUpload to flash done, will reset!\n");
// close connection to avoid retries by browser
uip_close();
reset_chip();
} else { } else {
print_string("Checksum incorrect!"); print_string("Checksum incorrect! Aborting.\n");
uip_close();
} }
print_string("\nUpload to flash done, will reset!\n");
// close connection to avoid retries by browser
uip_close();
reset_chip();
} }
// Make sure there is a 0 at the end of the uploaded data // Make sure there is a 0 at the end of the uploaded data
flash_buf[0] = 0; flash_buf[0] = 0;
@@ -387,6 +387,10 @@ void handle_post(void)
verify_crc = 1; verify_crc = 1;
max_upload = 1024576; max_upload = 1024576;
} else if (is_word(request_path, "config")) { } else if (is_word(request_path, "config")) {
if (!authenticated) {
send_unauthorized();
return;
}
dbg_string("Configuration upload, erasing config mem!\n"); dbg_string("Configuration upload, erasing config mem!\n");
uptr = CONFIG_START; uptr = CONFIG_START;
verify_crc = 0; verify_crc = 0;