Skip to content

Releases: ionux/ok_json

Documentation update for security release

17 Apr 01:57
d2dadba

Choose a tag to compare

Same parser code with security updates as v1.9.0 but with updated docs.

What's Changed

  • Update README with error codes table, return types, and expanded example by @ionux in #71
  • Update wiki docs to match recent README and CI changes by @ionux in #72

Full Changelog: v1.9.0...v1.9.1

Security and stability update

14 Apr 03:53
417a134

Choose a tag to compare

Thanks to securitychops for the project's first security report - and a very helpful one at that. Be sure to use this latest release which has addressed those issues and more.

Known Issues In This Release

Since this is a security release, there are a few known MISRA violations that will be resolved in an upcoming general release:

src/ok_json.c:820:18: style: misra violation [misra-c2012-18.4]
        diff = p - start;
                 ^
src/ok_json.c:2040:44: style: misra violation [misra-c2012-18.4]
            const char *end = parser->json + parser->json_len;
                                           ^
src/ok_json.c:2119:44: style: misra violation [misra-c2012-18.4]
            const char *end = parser->json + parser->json_len;
                                           ^
src/ok_json.c:2254:44: style: misra violation [misra-c2012-18.4]
            const char *end = parser->json + parser->json_len;
                                           ^
src/ok_json.c:2327:44: style: misra violation [misra-c2012-18.4]
            const char *end = parser->json + parser->json_len;
                                           ^
src/ok_json.c:2602:73: style: misra violation [misra-c2012-18.4]
                    dlen = okj_measure_container(t->start, parser->json + parser->json_len);
                                                                        ^

Code Coverage Report

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
src/ok_json.c                                614     614   100%
test/ok_json_tests.c                        2135    2135   100%
------------------------------------------------------------------------------
TOTAL                                       2749    2749   100%
------------------------------------------------------------------------------

FV Report

[wp] Running WP plugin...
[rte:annot] annotating function okj_init
[rte:annot] annotating function okj_get_string
[rte:annot] annotating function okj_get_number
[rte:annot] annotating function okj_get_boolean
[rte:annot] annotating function okj_get_array
[rte:annot] annotating function okj_get_object
[rte:annot] annotating function okj_get_token
[rte:annot] annotating function okj_get_array_raw
[rte:annot] annotating function okj_get_object_raw
[rte:annot] annotating function okj_copy_string
[rte:annot] annotating function okj_count_objects
[rte:annot] annotating function okj_count_arrays
[rte:annot] annotating function okj_count_elements
[rte:annot] annotating function okj_is_whitespace
[rte:annot] annotating function okj_is_digit
[rte:annot] annotating function okj_is_hex_digit
[rte:annot] annotating function okj_is_utf8_continuation
[rte:annot] annotating function okj_validate_utf8_sequence
[rte:annot] annotating function okj_match
[rte:annot] annotating function okj_is_value_terminator
[rte:annot] annotating function okj_skip_string
[rte:annot] annotating function okj_count_array_elements
[rte:annot] annotating function okj_count_object_members
[rte:annot] annotating function okj_measure_container
[rte:annot] annotating function okj_skip_whitespace
[rte:annot] annotating function okj_find_value_index
[wp] Computing [100 goals...]
[wp] Computing [200 goals...]
[wp] Computing [300 goals...]
[wp] Computing [400 goals...]
[wp] Computing [500 goals...]
[wp] Computing [600 goals...]
[wp] Computing [700 goals...]
[wp] Computing [800 goals...]
[wp] 816 goals scheduled
[wp] Proved goals:  840 / 840
  Terminating:      12
  Unreachable:      12
  Qed:             571 (0.99ms-69ms-37.3s)
  Alt-Ergo 2.5.4:  245 (9ms-31ms-127ms)

What's Changed

  • Add end-of-buffer boundary to container scanning helpers by @ionux in #63
  • docs: update README and wiki API reference to reflect current functio… by @ionux in #64
  • Fix four Frama-C WP timeouts in okj_measure_container by @ionux in #65
  • Fix Frama-C timeout on okj_measure_container loop variant by @ionux in #66
  • Fix WP timeout in okj_measure_container by @ionux in #67
  • Fix MISRA 10.8 violation in okj_measure_container by @ionux in #68
  • Fix heap-buffer-overread vulnerabilities from Issue #69 by @ionux in #70

Full Changelog: v1.0.0...v1.9.0

ok_json v1.0.0: The Safety-Critical Release

17 Mar 23:36
3ab4902

Choose a tag to compare

After extensive development and rigorous validation, ok_json has officially reached version 1.0.0.

This milestone marks the transition from a functional MVP to a production-ready, defense-grade C99 JSON parser. Designed specifically for memory-constrained and safety-critical systems, this release guarantees predictable execution, strict standard compliance, and absolute memory safety without relying on external dependencies (although it can be used in any software project, no just highly safe & critical ones!).

Key Highlights

  • Verified RFC 8259 Compliance: The parser has dropped its "provisional" status. It has been mathematically verified against Nicolas Seriot's industry-standard JSONTestSuite, successfully handling the most hostile and structurally complex JSON edge cases known to the community.
  • Strict MISRA C:2012 Alignment: The codebase passes rigorous static analysis with zero outstanding MISRA C:2012 violations. All core logic has been refactored to ensure single-return paths, exhaustive conditionals, and optimized ROM footprints.
  • Cryptographic Memory Safety: Integrated libFuzzer with AddressSanitizer (ASan) and UndefinedBehaviorSanitizer (UBSan) into the continuous integration pipeline. The parser has been proven to gracefully reject millions of malformed, randomized byte sequences without a single memory leak, buffer over-read, or undefined behavior event.
  • Zero Dynamic Allocation: 100% stack-based execution. No malloc, no free, and zero standard library dependencies.

Testing & Quality Assurance

  • Coverage: 100% branch and statement coverage maintained across 190+ unit tests.
  • Continuous Integration: Parallelized automated workflows now enforce compilation, memory checking (Valgrind), MISRA static analysis (cppcheck), and continuous fuzzing on every commit.

What's Changed

  • Add MVP roadmap document for ok_json parser by @ionux in #1
  • Fix all 7 MVP bugs, implement getters, remove stdlib dependencies by @ionux in #2
  • Add Phase 4 tests, fix max-tokens detection, Phase 5 docs/polish by @ionux in #3
  • Update MVP_ROADMAP and TODO_LIST to reflect current completed state by @ionux in #4
  • Fix #3 and #4: populate array/object count and enforce string length … by @ionux in #5
  • Fix #7: handle backslash escape sequences in string scanning by @ionux in #6
  • Add MISRA-oriented warning flags to CFLAGS by @ionux in #7
  • Enforce max array and object size limits in getters by @ionux in #8
  • Add array/object raw getters, element counters, and debug print by @ionux in #9
  • Add OKJ_MAX_JSON_LEN constant and enforce it in okj_parse() by @ionux in #10
  • docs: add comprehensive local wiki and link from README by @ionux in #11
  • Add RFC 8259 escape sequence validation and tests by @ionux in #12
  • Implement complete RFC 8259 number format parsing and tests by @ionux in #13
  • Add 9 boundary tests covering empty containers, nested types, null, k… by @ionux in #14
  • Fix return codes and add missing error-path tests by @ionux in #15
  • Ensure all processed strings are null-terminated for safety by @ionux in #16
  • Add fixed-size depth/state stack with bracket matching and depth ceiling by @ionux in #17
  • Update TODO_LIST and MVP_ROADMAP to reflect current project state by @ionux in #18
  • Reject bare control characters in strings per RFC 8259 §7 by @ionux in #19
  • Validate single top-level value and reject trailing non-whitespace by @ionux in #20
  • Enforce full RFC 8259 grammar compliance in parser by @ionux in #21
  • Enforce UTF-8 validity for RFC 8259 string parsing by @ionux in #22
  • Add unit test for realistic IoT sensor JSON payload by @ionux in #23
  • Add unit test for two-element user data JSON array by @ionux in #24
  • Add unit test for deeply nested valid JSON by @ionux in #25
  • Add unit test exercising upper limits of the JSON parser by @ionux in #26
  • Update README to match current API and header definitions by @ionux in #27
  • Add test_object_exactly_32_members test by @ionux in #28
  • test: add MC/DC UTF-8 tests for okj_validate_utf8_sequence by @ionux in #29
  • Add unit test for null byte injected into a string token by @ionux in #30
  • Add unit tests for okj_copy_string with a 1-byte destination buffer by @ionux in #31
  • test: enforce first-match-wins contract for duplicate JSON keys by @ionux in #32
  • Add test_empty_string_key to verify RFC 8259 empty-string key handling by @ionux in #33
  • Add boundary test for OKJ_MAX_JSON_LEN (4096 vs 4097 bytes) by @ionux in #34
  • test: add test_null_pointer_safety for exhaustive NULL API boundary c… by @ionux in #35
  • Add test for RFC 8259 Unicode surrogate-pair escape sequences by @ionux in #36
  • test: add test_number_large_near_json_limit by @ionux in #37
  • test: add test_depth_stack_alternating_unwind by @ionux in #38
  • Add RFC 8259 whitespace stress test for okj_skip_whitespace() by @ionux in #39
  • test: add RFC 8259 bare control character rejection tests by @ionux in #40
  • test: add quoted-string spoofing test for okj_skip_string() robustness by @ionux in #41
  • test: prove Modified UTF-8 overlong NUL (0xC0 0x80) is rejected as OK… by @ionux in #42
  • fix: guard against escape sequence straddling the OKJ_MAX_STRING_LEN … by @ionux in #43
  • Sync with main. by @ionux in #44
  • Refactor for MISRA compliance. by @ionux in #45
  • Add unit test for okj_match() null src and lit parameters by @ionux in #46
  • docs(wiki): align documentation with current source code by @ionux in #47
  • Add unit test for okj_validate_utf8_sequence() null parameter guards by @ionux in #48
  • Add unit tests for okj_get_number() null parser and key parameters by @ionux in #49
  • Add null parameter unit tests for all getter functions by @ionux in #50
  • Add nonexistent-key unit tests for all okj_find_value_index() getters by @ionux in #51
  • Include src/ok_json.c directly in test file for full static-function … by @ionux in #52
  • Add unit tests covering 16 previously uncovered branches in ok_json.c by @ionux in #53
  • Update MVP_ROADMAP and TODO_LIST to reflect current project state by @ionux in #54
  • Refactor getter functions to caller-provided output pattern by @ionux in #55
  • docs: update API docs to reflect output-parameter getter signatures by @ionux in #56
  • Require explicit length params for all string/key inputs by @ionux in #57
  • docs: update all docs to reflect current function signatures by @ionux in #58
  • docs: update MVP_ROADMAP and TODO_LIST to reflect current project state by @ionux in #59
  • docs: update MVP_ROADMAP and TODO_LIST to reflect passing fuzzer by @ionux in #60
  • docs: record JSONTestSuite 283/283 compliance verification by @ionux in #61
  • wiki: correct and complete documentation by @ionux in #62

Full Changelog: https://github.com/ionux/ok_json/commits/v1.0.0