Git Product home page Git Product logo

libcsuit's People

Contributors

hannestschofenig avatar hisanak avatar kentakayama avatar yuichitk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

libcsuit's Issues

Missing input validation: unchecked payload length when decoding CBOR text string labeled items

Issue:

The suit_payload_t array inside the suit_payloads_t struct can be overflowed by the function suit_decode_envelope_from_item.
A missing check of suit_payloads_t.len allows writing beyond the suit_payloads_t.payload array boundary.
This occurs at the condition suit_manifest_decode.c:1032, where values are written to the payload at position payloads.len and payloads.len is increased.

Reproduction:

The examples/suit_manifest_parser_main_psa.c file can be used for reproduction.
Therefore replace the given manifest with this manifest: crash.zip
Execution should lead to a Segmentation fault.

Affects:

master (commit 6fdbecd).
At a quick glance it seems that there are more length checks missing for arrays in typedefs of suit_common.h.

Suggested patch:

#16: Check if payloads.len >= SUIT_MAX_ARRAY_LENGTH before accessing payload array items.

use QCBOR BstrWrap feature

use these functions below, instead of creating context from QCBOR_BYTE_STRING item with QCBOREncode_Init() and QCBORDecode_Init() .

QCBOREncode_BstrWrap()
QCBOREncode_CloseBstrWrap()
QCBORDecode_EnterBstrWrapped()
QCBORDecode_ExitBstrWrapped()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.