security: fix multiple vulnerabilities in C code across packages#1378
Open
aparcar wants to merge 1 commit into
Open
security: fix multiple vulnerabilities in C code across packages#1378aparcar wants to merge 1 commit into
aparcar wants to merge 1 commit into
Conversation
Critical fixes: - tinysrp: fix remote stack buffer overflow in tsrp_server_authenticate() where a network-controlled byte could write up to 255 bytes into a 32-byte stack buffer (CVE-worthy, remote code execution) - fritz_tffs_nand_read: fix incorrect pointer arithmetic in memset that caused out-of-bounds write (segments + num_segments * sizeof() should be segments + num_segments since C scales pointer arithmetic by type) - fis: fix negative memset size (tmp - end was negative, wrapping to huge size_t value; corrected to end - tmp) - ead: fix integer underflow in handle_send_a() where unsigned subtraction could wrap to negative int, bypassing bounds check High-severity fixes: - ead-client: add bounds check in handle_b() for network-controlled memcpy length into fixed MAXPARAMLEN buffer - ead-client: add bounds check in handle_prime() for salt length (0-255 from network) into 32-byte saltbuf - ead-client: replace strcpy with strncpy in send_username() to prevent overflow of 32-byte username field - ead: add NULL check after malloc for ead_instance allocation - swconfig: add NULL checks after malloc in store_port_val(), store_link_val(), swlib_set_attr_string(), and swlib_map_settings() - jffs2/mtd: add NULL checks after malloc for erase buffer allocation - fritz_tffs_nand_read: add NULL check after realloc for segments Medium-severity fixes: - ead: increase PID buffer from 8 to 16 bytes to prevent overflow with high PID values - ead: check read() return value from /dev/urandom - jboot_config_read: fix pointer-to-uint32_t truncation on 64-bit systems (use uintptr_t instead) - nvram: fix pointer-to-int truncation on 64-bit systems for alignment calculation (use uintptr_t) - patch-cmdline: fix munmap size to match mmap size instead of using unrelated strlen value - mtd: add bounds check on partition name memcpy and array index https://claude.ai/code/session_01NE3Ds4oKxq2Bky281LYx4h
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.
Critical fixes:
where a network-controlled byte could write up to 255 bytes into a
32-byte stack buffer (CVE-worthy, remote code execution)
caused out-of-bounds write (segments + num_segments * sizeof() should
be segments + num_segments since C scales pointer arithmetic by type)
huge size_t value; corrected to end - tmp)
subtraction could wrap to negative int, bypassing bounds check
High-severity fixes:
memcpy length into fixed MAXPARAMLEN buffer
(0-255 from network) into 32-byte saltbuf
overflow of 32-byte username field
store_link_val(), swlib_set_attr_string(), and swlib_map_settings()
Medium-severity fixes:
high PID values
systems (use uintptr_t instead)
calculation (use uintptr_t)
unrelated strlen value
https://claude.ai/code/session_01NE3Ds4oKxq2Bky281LYx4h