Standard Violation: According to Annex 10, Volume 1 (Aeronautical Telecommunications), a PRN mask should only be processed with 51 or less bits set to 1.
Technical Insight: The iodf[4] array is initialized to handle segments of up to 13 satellites, assuming that the PRN mask does not exceed 51 bits. With MAXSAT set to 229 possible satellites, accessing the iodf array with iodf[i/13] risks out-of-bounds reads if the PRN mask is set to more than 51 bits against the standard.
Potential Impact: This issue can lead to undefined behavior, including segmentation faults.
Suggested Fix:
Implement checks to enforce the PRN mask limit as per Annex 10 before processing the PRN mask in decode_sbstype6.
Steps to Reproduce:
Process an SBAS message with the PRN mask set to more than 51 bits in decode_sbstype6.
Observe the behavior or error due to out-of-bounds array access.
Issue Summary: The
decode_sbstype6
function insbas.c
may perform an array out-of-bounds read when handling a PRN mask set to more than 51 bits. https://github.com/tomojitakasu/RTKLIB/blob/71db0ffa0d9735697c6adfd06fdf766d0e5ce807/src/sbas.c#L201Details:
iodf[4]
array is initialized to handle segments of up to 13 satellites, assuming that the PRN mask does not exceed 51 bits. WithMAXSAT
set to 229 possible satellites, accessing theiodf
array withiodf[i/13]
risks out-of-bounds reads if the PRN mask is set to more than 51 bits against the standard.Suggested Fix: Implement checks to enforce the PRN mask limit as per Annex 10 before processing the PRN mask in
decode_sbstype6
.Steps to Reproduce:
decode_sbstype6
.