tomojitakasu / RTKLIB

2.58k stars 1.63k forks source link

Out-of-Bounds Read in decode_sbstype6 for PRN Mask > 51 Bits #747

Open tech-nickel opened 8 months ago

tech-nickel commented 8 months ago

Issue Summary: The decode_sbstype6 function in sbas.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#L201

Details:

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:

  1. Process an SBAS message with the PRN mask set to more than 51 bits in decode_sbstype6.
  2. Observe the behavior or error due to out-of-bounds array access.
nahuelmol commented 8 months ago

I was reading the code but I don't understand how is justified the use of 13 for grouping satellites. Maybe Iam overlooking something