Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security report]: Patch for CVE-2020-26243 found in reused component nanopb by using V1SCAN #6312

Open
ltcdCai opened this issue Jul 23, 2024 · 1 comment

Comments

@ltcdCai
Copy link

ltcdCai commented Jul 23, 2024

Contact me:
[email protected]

References:

Github Security Advisory for CVE-2020-26243
NVD description
Commit for CVE-2020-26243

Steps to reproduce it

Patch suggestion:
Replace the code at lines 406-415 with the following code:

            if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE &&
                *(pb_size_t*)iter->pSize != iter->pos->tag)
            {
                /* We memset to zero so that any callbacks are set to NULL.
                 * This is because the callbacks might otherwise have values
                 * from some other union field. */
                memset(iter->pData, 0, iter->pos->data_size);
                pb_message_set_to_defaults((const pb_field_t*)iter->pos->ptr, iter->pData);
            }
            *(pb_size_t*)iter->pSize = iter->pos->tag;

            return func(stream, iter->pos, iter->pData);
@sunghan-chang
Copy link
Contributor

@jylee9613 Could you check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants