Skip to content

Conversation

@itsvishalchauhan
Copy link

Summary

This PR fixes multiple input validation vulnerabilities that could cause crashes or undefined behavior when processing malformed OCPP messages or server responses.

Vulnerabilities Fixed

High Severity

  • MOC-003: NULL pointer dereference in Request/Response parsing
    • Files: Request.cpp, RequestQueue.cpp
    • Fix: Add bounds validation before array access

Medium Severity

  • MOC-001: Out-of-bounds read in timestamp fractional second parsing (Time.cpp)
  • MOC-004: NULL pointer in TransactionEvent nested JSON access (TransactionEvent.cpp)
  • MOC-005: Typo "parenIdTag""parentIdTag" (MicroOcpp.cpp)

Low/Informational

  • MOC-006: Integer overflow in FTP PASV port calculation (FtpMbedTLS.cpp)
  • MOC-007: Integer overflow in configuration parsing (Configuration.cpp, ChangeConfiguration.cpp, VariableService.cpp)
  • MOC-002: Unsigned underflow with zero-length certificate serial (CertificateMbedTLS.cpp)

Testing

  • All fixes preserve existing behavior for valid inputs
  • Invalid inputs now return errors instead of causing crashes

Breaking Changes

None - all fixes are backwards compatible


Vulnerabilities identified and remediation proposed by Nebari.ai — AI-native proactive security intelligence solution

Security fixes for multiple input validation issues:

- MOC-001: Fix OOB read in timestamp fractional second parsing (Time.cpp)
- MOC-002: Add zero-length serial number check in certificate parsing (CertificateMbedTLS.cpp)
- MOC-003: Add bounds validation in OCPP message parsing (Request.cpp, RequestQueue.cpp)
- MOC-004: Fix NULL pointer dereference in TransactionEvent (TransactionEvent.cpp)
- MOC-005: Fix typo causing NULL pointer (parenIdTag → parentIdTag) (MicroOcpp.cpp)
- MOC-006: Validate FTP PASV response values are valid octets (FtpMbedTLS.cpp)
- MOC-007: Add overflow-safe integer parsing for configuration (Configuration.cpp/.h, ChangeConfiguration.cpp, VariableService.cpp)

These issues were identified during security review and could cause
crashes or undefined behavior when processing malformed OCPP messages
or server responses.
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

Successfully merging this pull request may close these issues.

1 participant