目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CVE-2021-21401 PoC — Nanopb 安全漏洞

来源
关联漏洞
标题:Nanopb 安全漏洞 (CVE-2021-21401)
Description:Nanopb是Nanopb个人开发者的一个适用于微处理器的协议缓冲区实现。 Nanopb 存在安全漏洞,该漏洞导致无效的“free()”或“realloc()的调用。
介绍
Nanopb - Protocol Buffers for Embedded Systems
==============================================

[![Build Status](https://travis-ci.org/nanopb/nanopb.svg?branch=master)](https://travis-ci.org/nanopb/nanopb)

Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is
especially suitable for use in microcontrollers, but fits any memory
restricted system.

* **Homepage:** https://jpa.kapsi.fi/nanopb/
* **Documentation:** https://jpa.kapsi.fi/nanopb/docs/
* **Downloads:** https://jpa.kapsi.fi/nanopb/download/
* **Forum:** https://groups.google.com/forum/#!forum/nanopb



Using the nanopb library
------------------------
To use the nanopb library, you need to do two things:

1. Compile your .proto files for nanopb, using protoc.
2. Include pb_encode.c, pb_decode.c and pb_common.c in your project.

The easiest way to get started is to study the project in "examples/simple".
It contains a Makefile, which should work directly under most Linux systems.
However, for any other kind of build system, see the manual steps in
README.txt in that folder.



Using the Protocol Buffers compiler (protoc)
--------------------------------------------
The nanopb generator is implemented as a plugin for the Google's own protoc
compiler. This has the advantage that there is no need to reimplement the
basic parsing of .proto files. However, it does mean that you need the
Google's protobuf library in order to run the generator.

If you have downloaded a binary package for nanopb (either Windows, Linux or
Mac OS X version), the 'protoc' binary is included in the 'generator-bin'
folder. In this case, you are ready to go. Simply run this command:

    generator-bin/protoc --nanopb_out=. myprotocol.proto

However, if you are using a git checkout or a plain source distribution, you
need to provide your own version of protoc and the Google's protobuf library.
On Linux, the necessary packages are protobuf-compiler and python-protobuf.
On Windows, you can either build Google's protobuf library from source or use
one of the binary distributions of it. In either case, if you use a separate
protoc, you need to manually give the path to nanopb generator:

    protoc --plugin=protoc-gen-nanopb=nanopb/generator/protoc-gen-nanopb ...



Running the tests
-----------------
If you want to perform further development of the nanopb core, or to verify
its functionality using your compiler and platform, you'll want to run the
test suite. The build rules for the test suite are implemented using Scons,
so you need to have that installed. To run the tests:

    cd tests
    scons

This will show the progress of various test cases. If the output does not
end in an error, the test cases were successful.

Note: Mac OS X by default aliases 'clang' as 'gcc', while not actually
supporting the same command line options as gcc does. To run tests on
Mac OS X, use: "scons CC=clang CXX=clang". Same way can be used to run
tests with different compilers on any platform.
文件快照

[4.0K] /data/pocs/a7680b9ef0f63d13963150f05e9614f8036c6d2c ├── [1.8K] Android.bp ├── [1.6K] AUTHORS.txt ├── [ 340] BUILD ├── [ 13K] CHANGELOG.txt ├── [2.3K] CleanSpec.mk ├── [3.1K] CMakeLists.txt ├── [1.2K] CONTRIBUTING.md ├── [4.0K] docs │   ├── [ 17K] concepts.rst │   ├── [112K] generator_flow.svg │   ├── [5.3K] index.rst │   ├── [4.0K] logo │   │   ├── [ 854] logo16px.png │   │   ├── [2.5K] logo48px.png │   │   ├── [ 15K] logo.png │   │   └── [101K] logo.svg │   ├── [3.5K] lsr.css │   ├── [ 293] Makefile │   ├── [ 348] menu.rst │   ├── [ 12K] migration.rst │   ├── [ 35K] reference.rst │   └── [3.8K] security.rst ├── [4.0K] examples │   ├── [4.0K] cmake_relpath │   │   ├── [ 644] CMakeLists.txt │   │   ├── [4.0K] proto │   │   │   ├── [ 226] simple.proto │   │   │   └── [4.0K] sub │   │   │   └── [ 75] unlucky.proto │   │   ├── [ 533] README.txt │   │   └── [2.3K] simple.c │   ├── [4.0K] cmake_simple │   │   ├── [ 598] CMakeLists.txt │   │   ├── [ 533] README.txt │   │   ├── [2.2K] simple.c │   │   └── [ 158] simple.proto │   ├── [4.0K] network_server │   │   ├── [3.8K] client.c │   │   ├── [ 921] common.c │   │   ├── [ 175] common.h │   │   ├── [ 520] fileproto.options │   │   ├── [ 423] fileproto.proto │   │   ├── [ 356] Makefile │   │   ├── [2.1K] README.txt │   │   └── [4.6K] server.c │   ├── [4.0K] simple │   │   ├── [ 720] Makefile │   │   ├── [ 835] README.txt │   │   ├── [ 521] rules.mk │   │   ├── [2.2K] simple.c │   │   ├── [ 511] simple.pb.c │   │   ├── [1.2K] simple.pb.h │   │   └── [ 158] simple.proto │   ├── [4.0K] using_double_on_avr │   │   ├── [ 765] decode_double.c │   │   ├── [2.6K] double_conversion.c │   │   ├── [ 749] double_conversion.h │   │   ├── [ 358] doubleproto.proto │   │   ├── [ 599] encode_double.c │   │   ├── [ 594] Makefile │   │   ├── [1.0K] README.txt │   │   └── [1.6K] test_conversions.c │   └── [4.0K] using_union_messages │   ├── [2.6K] decode.c │   ├── [2.2K] encode.c │   ├── [ 412] Makefile │   ├── [2.0K] README.txt │   └── [ 631] unionproto.proto ├── [4.0K] extra │   ├── [ 13K] FindNanopb.cmake │   ├── [ 56] nanopb-config.cmake │   ├── [ 390] nanopb-config-version.cmake.in │   ├── [1.1K] nanopb.mk │   └── [2.3K] pb_syshdr.h ├── [4.0K] generator │   ├── [ 486] Android.bp │   ├── [4.0K] google │   │   └── [4.0K] protobuf │   │   └── [1.8K] __init__.py │   ├── [4.0K] nanopb │   │   └── [4.0K] options.proto │   ├── [ 66K] nanopb_generator.py │   ├── [4.0K] proto │   │   ├── [4.0K] google │   │   │   └── [4.0K] protobuf │   │   │   └── [ 35K] descriptor.proto │   │   ├── [ 0] __init__.py │   │   ├── [ 78] Makefile │   │   ├── [3.6K] nanopb.proto │   │   └── [7.4K] plugin.proto │   ├── [ 467] protoc-gen-nanopb │   └── [ 446] protoc-gen-nanopb.bat ├── [ 743] library.json ├── [ 898] LICENSE.txt ├── [ 0] MODULE_LICENSE_PUBLIC_DOMAIN ├── [ 898] NOTICE ├── [ 180] OWNERS ├── [4.0K] patches │   └── [ 938] pb.h.patch ├── [2.9K] pb_common.c ├── [1.4K] pb_common.h ├── [ 46K] pb_decode.c ├── [6.4K] pb_decode.h ├── [ 26K] pb_encode.c ├── [6.1K] pb_encode.h ├── [ 23K] pb.h ├── [ 422] README.android ├── [2.9K] README.md ├── [ 98] README.version ├── [4.0K] tests │   ├── [4.0K] alltypes │   │   ├── [ 67] alltypes.options │   │   ├── [4.4K] alltypes.proto │   │   ├── [ 13K] decode_alltypes.c │   │   ├── [5.9K] encode_alltypes.c │   │   └── [1.9K] SConscript │   ├── [4.0K] alltypes_callback │   │   ├── [ 246] alltypes.options │   │   ├── [ 14K] decode_alltypes_callback.c │   │   ├── [ 15K] encode_alltypes_callback.c │   │   └── [1.4K] SConscript │   ├── [4.0K] alltypes_pointer │   │   ├── [ 93] alltypes.options │   │   ├── [9.2K] decode_alltypes_pointer.c │   │   ├── [8.7K] encode_alltypes_pointer.c │   │   └── [1.6K] SConscript │   ├── [4.0K] alltypes_proto3 │   │   ├── [ 68] alltypes.options │   │   ├── [2.7K] alltypes.proto │   │   ├── [6.9K] decode_alltypes.c │   │   ├── [4.0K] encode_alltypes.c │   │   └── [1.8K] SConscript │   ├── [4.0K] alltypes_proto3_callback │   │   ├── [ 246] alltypes.options │   │   ├── [ 12K] decode_alltypes_callback.c │   │   ├── [ 12K] encode_alltypes_callback.c │   │   └── [1017] SConscript │   ├── [4.0K] anonymous_oneof │   │   ├── [2.0K] decode_oneof.c │   │   ├── [ 450] oneof.proto │   │   └── [1.1K] SConscript │   ├── [4.0K] backwards_compatibility │   │   ├── [ 10K] alltypes_legacy.c │   │   ├── [ 11K] alltypes_legacy.h │   │   ├── [ 29] alltypes_legacy.options │   │   ├── [3.9K] alltypes_legacy.proto │   │   ├── [8.5K] decode_legacy.c │   │   ├── [4.8K] encode_legacy.c │   │   └── [ 398] SConscript │   ├── [4.0K] basic_buffer │   │   ├── [2.2K] decode_buffer.c │   │   ├── [1.1K] encode_buffer.c │   │   └── [ 508] SConscript │   ├── [4.0K] basic_stream │   │   ├── [2.0K] decode_stream.c │   │   ├── [1.1K] encode_stream.c │   │   └── [ 508] SConscript │   ├── [4.0K] buffer_only │   │   └── [1.1K] SConscript │   ├── [4.0K] callbacks │   │   ├── [ 445] callbacks.proto │   │   ├── [3.0K] decode_callbacks.c │   │   ├── [2.5K] encode_callbacks.c │   │   └── [ 525] SConscript │   ├── [4.0K] common │   │   ├── [1.1K] malloc_wrappers.c │   │   ├── [ 197] malloc_wrappers.h │   │   ├── [ 353] malloc_wrappers_syshdr.h │   │   ├── [ 461] person.proto │   │   ├── [1.8K] SConscript │   │   ├── [ 268] test_helpers.h │   │   ├── [ 905] unittestproto.proto │   │   └── [ 345] unittests.h │   ├── [4.0K] cxx_main_program │   │   └── [1.1K] SConscript │   ├── [4.0K] cyclic_messages │   │   ├── [ 259] cyclic_callback.options │   │   ├── [ 534] cyclic.proto │   │   ├── [3.8K] encode_cyclic_callback.c │   │   └── [ 343] SConscript │   ├── [4.0K] decode_unittests │   │   ├── [ 16K] decode_unittests.c │   │   └── [ 100] SConscript │   ├── [4.0K] encode_unittests │   │   ├── [ 11K] encode_unittests.c │   │   └── [ 172] SConscript │   ├── [4.0K] enum_sizes │   │   ├── [2.0K] enumsizes.proto │   │   ├── [2.1K] enumsizes_unittests.c │   │   └── [ 336] SConscript │   ├── [4.0K] enum_to_string │   │   ├── [ 305] enum.proto │   │   ├── [ 523] enum_to_string.c │   │   └── [ 148] SConscript │   ├── [4.0K] extensions │   │   ├── [1.4K] decode_extensions.c │   │   ├── [1.3K] encode_extensions.c │   │   ├── [ 14] extensions.options │   │   ├── [ 492] extensions.proto │   │   └── [ 648] SConscript │   ├── [4.0K] extra_fields │   │   ├── [ 523] alltypes_with_extra_fields.pb │   │   ├── [ 180] person_with_extra_field.expected │   │   ├── [ 124] person_with_extra_field.pb │   │   └── [ 927] SConscript │   ├── [4.0K] field_size_16 │   │   ├── [ 68] alltypes.options │   │   ├── [4.0K] alltypes.proto │   │   └── [1.2K] SConscript │   ├── [4.0K] field_size_16_proto3 │   │   ├── [ 101] alltypes.options │   │   ├── [2.7K] alltypes.proto │   │   ├── [6.8K] decode_alltypes.c │   │   ├── [4.0K] encode_alltypes.c │   │   └── [1.1K] SConscript │   ├── [4.0K] field_size_32 │   │   ├── [ 67] alltypes.options │   │   ├── [4.1K] alltypes.proto │   │   └── [1.2K] SConscript │   ├── [4.0K] fixed_count │   │   ├── [ 491] fixed_count.proto │   │   ├── [3.4K] fixed_count_unittests.c │   │   └── [ 335] SConscript │   ├── [4.0K] fuzztest │   │   ├── [ 92] alltypes_pointer.options │   │   ├── [ 95] alltypes_static.options │   │   ├── [5.6K] fuzzstub.c │   │   ├── [ 12K] fuzztest.c │   │   ├── [2.5K] generate_message.c │   │   ├── [ 133] run_radamsa.sh │   │   ├── [4.0K] sample_data │   │   │   ├── [ 573] sample1.pb │   │   │   └── [ 466] sample2.pb │   │   └── [1.8K] SConscript │   ├── [4.0K] inline │   │   ├── [ 59] inline.expected │   │   ├── [ 361] inline.proto │   │   ├── [2.2K] inline_unittests.c │   │   └── [ 363] SConscript │   ├── [4.0K] intsizes │   │   ├── [1.6K] intsizes.proto │   │   ├── [6.2K] intsizes_unittests.c │   │   └── [ 305] SConscript │   ├── [4.0K] io_errors │   │   ├── [ 67] alltypes.options │   │   ├── [3.5K] io_errors.c │   │   └── [ 438] SConscript │   ├── [4.0K] io_errors_pointers │   │   ├── [ 92] alltypes.options │   │   └── [ 849] SConscript │   ├── [ 466] Makefile │   ├── [4.0K] map │   │   ├── [1.5K] decode_map.c │   │   ├── [ 996] encode_map.c │   │   ├── [ 78] map.options │   │   ├── [ 79] map.proto │   │   └── [ 593] SConscript │   ├── [4.0K] mem_release │   │   ├── [5.5K] mem_release.c │   │   ├── [ 984] mem_release.proto │   │   └── [ 386] SConscript │   ├── [4.0K] message_sizes │   │   ├── [ 126] dummy.c │   │   ├── [ 548] messages1.proto │   │   ├── [ 180] messages2.proto │   │   └── [ 264] SConscript │   ├── [4.0K] missing_fields │   │   ├── [1.3K] missing_fields.c │   │   ├── [4.2K] missing_fields.proto │   │   └── [ 278] SConscript │   ├── [4.0K] multiple_files │   │   ├── [ 35] multifile1.options │   │   ├── [ 624] multifile1.proto │   │   ├── [ 466] multifile2.proto │   │   ├── [ 490] SConscript │   │   ├── [4.0K] subdir │   │   │   └── [ 411] multifile2.proto │   │   └── [ 800] test_multiple_files.c │   ├── [4.0K] no_errmsg │   │   └── [1.1K] SConscript │   ├── [4.0K] no_messages │   │   ├── [ 103] no_messages.proto │   │   └── [ 141] SConscript │   ├── [4.0K] oneof │   │   ├── [3.1K] decode_oneof.c │   │   ├── [1.6K] encode_oneof.c │   │   ├── [ 589] oneof.proto │   │   └── [1.1K] SConscript │   ├── [4.0K] options │   │   ├── [ 476] options.expected │   │   ├── [1.8K] options.proto │   │   ├── [ 68] proto3_options.expected │   │   ├── [ 198] proto3_options.proto │   │   └── [ 302] SConscript │   ├── [4.0K] package_name │   │   └── [1.4K] SConscript │   ├── [4.0K] regression │   │   ├── [4.0K] issue_118 │   │   │   ├── [ 118] enumdef.proto │   │   │   ├── [ 115] enumuse.proto │   │   │   └── [ 303] SConscript │   │   ├── [4.0K] issue_125 │   │   │   ├── [ 53] extensionbug.expected │   │   │   ├── [ 80] extensionbug.options │   │   │   ├── [ 231] extensionbug.proto │   │   │   └── [ 242] SConscript │   │   ├── [4.0K] issue_141 │   │   │   ├── [ 206] SConscript │   │   │   ├── [ 211] testproto.expected │   │   │   └── [ 928] testproto.proto │   │   ├── [4.0K] issue_145 │   │   │   ├── [ 32] comments.expected │   │   │   ├── [ 148] comments.options │   │   │   ├── [ 104] comments.proto │   │   │   └── [ 225] SConscript │   │   ├── [4.0K] issue_166 │   │   │   ├── [1.2K] enum_encoded_size.c │   │   │   ├── [ 238] enums.proto │   │   │   └── [ 285] SConscript │   │   ├── [4.0K] issue_172 │   │   │   ├── [ 129] msg_size.c │   │   │   ├── [ 495] SConscript │   │   │   ├── [4.0K] submessage │   │   │   │   ├── [ 29] submessage.options │   │   │   │   └── [ 71] submessage.proto │   │   │   └── [ 101] test.proto │   │   ├── [4.0K] issue_188 │   │   │   ├── [ 464] oneof.proto │   │   │   └── [ 95] SConscript │   │   ├── [4.0K] issue_195 │   │   │   ├── [ 255] SConscript │   │   │   ├── [ 29] test.expected │   │   │   └── [ 179] test.proto │   │   ├── [4.0K] issue_203 │   │   │   ├── [ 123] file1.proto │   │   │   ├── [ 123] file2.proto │   │   │   └── [ 272] SConscript │   │   ├── [4.0K] issue_205 │   │   │   ├── [ 437] SConscript │   │   │   ├── [ 213] size_corruption.c │   │   │   └── [ 207] size_corruption.proto │   │   ├── [4.0K] issue_227 │   │   │   ├── [ 435] SConscript │   │   │   ├── [ 299] unaligned_uint64.c │   │   │   └── [ 156] unaligned_uint64.proto │   │   ├── [4.0K] issue_229 │   │   │   ├── [1.0K] multiple_oneof.c │   │   │   ├── [ 163] multiple_oneof.proto │   │   │   └── [ 355] SConscript │   │   ├── [4.0K] issue_242 │   │   │   ├── [ 356] SConscript │   │   │   ├── [1.3K] zero_value.c │   │   │   └── [ 243] zero_value.proto │   │   ├── [4.0K] issue_247 │   │   │   ├── [ 731] padding.c │   │   │   ├── [ 167] padding.proto │   │   │   └── [ 307] SConscript │   │   ├── [4.0K] issue_249 │   │   │   ├── [ 316] SConscript │   │   │   ├── [1.4K] test.c │   │   │   └── [ 124] test.proto │   │   ├── [4.0K] issue_253 │   │   │   ├── [ 330] SConscript │   │   │   ├── [ 604] short_array.c │   │   │   └── [ 129] short_array.proto │   │   ├── [4.0K] issue_256 │   │   │   ├── [ 376] SConscript │   │   │   ├── [1.1K] submsg_array.c │   │   │   └── [ 180] submsg_array.proto │   │   ├── [4.0K] issue_259 │   │   │   ├── [ 770] callback_pointer.c │   │   │   ├── [ 212] callback_pointer.proto │   │   │   └── [ 648] SConscript │   │   ├── [4.0K] issue_306 │   │   │   ├── [ 15] large_extension.expected │   │   │   ├── [ 110] large_extension.proto │   │   │   └── [ 191] SConscript │   │   └── [4.0K] issue_322 │   │   ├── [1.3K] defaults.c │   │   ├── [ 423] defaults.proto │   │   └── [ 285] SConscript │   ├── [6.2K] SConstruct │   ├── [4.0K] site_scons │   │   ├── [4.2K] site_init.py │   │   └── [4.0K] site_tools │   │   └── [4.0K] nanopb.py │   ├── [4.0K] special_characters │   │   ├── [ 17] funny-proto+name has.characters.proto │   │   └── [ 181] SConscript │   ├── [4.0K] splint │   │   ├── [ 437] SConscript │   │   └── [ 526] splint.rc │   └── [4.0K] without_64bit │   ├── [ 67] alltypes.options │   ├── [3.2K] alltypes.proto │   ├── [7.6K] decode_alltypes.c │   ├── [4.3K] encode_alltypes.c │   ├── [ 249] no_64bit_syshdr.h │   └── [1.9K] SConscript ├── [4.0K] tools │   ├── [1.4K] make_linux_package.sh │   ├── [1.3K] make_mac_package.sh │   ├── [3.3K] make_windows_package.sh │   └── [ 633] set_version.sh └── [ 43] WORKSPACE 90 directories, 315 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →