Skip to content

Fix nasa/cFS#945: Harden CS_OneShotCmd against DoS via secondary memory validation#122

Open
Shrey-N wants to merge 4 commits intonasa:mainfrom
Shrey-N:main
Open

Fix nasa/cFS#945: Harden CS_OneShotCmd against DoS via secondary memory validation#122
Shrey-N wants to merge 4 commits intonasa:mainfrom
Shrey-N:main

Conversation

@Shrey-N
Copy link

@Shrey-N Shrey-N commented Mar 7, 2026

Checklist (Please check before submitting)

Describe the contribution
This PR addresses a critical Denial of Service (DoS) vulnerability in the CS application's OneShot command. On certain platforms, the initial memory validation is too permissive, allowing invalid or unmapped addresses to be passed to the background child task. When the child task attempts to calculate a checksum on this memory, it triggers a segmentation fault (SIGSEGV) and crashes the application.

This fix introduces a secondary, application level validation layer that checks requested memory ranges against a whitelist of known safe segments.

Testing performed

  1. Build steps: Built targeting the pc-linux platform within a standard cFS bundle.
  2. Execution steps:
    • Sent a OneShot command with an unmapped memory address.
    • Verified the command was rejected with a specific error event.
    • Verified the command error counter incremented.
    • Verified the CS application remained stable (no crash).
    • Verified that valid memory requests still process correctly.

Expected behavior changes

  • API Change: Added a new internal utility function for address range verification.
  • Behavior Change: OneShot commands requesting memory outside of configured safe zones are now rejected with an error event instead of crashing the system.
  • Impact: Security hardening for the Checksum application.

System(s) tested on

  • Hardware: PC (x86_64)
  • OS: Ubuntu 22.04 LTS
  • Versions: cFE 7.0 (Latest Release)

Additional context
The validation logic was implemented using overflow safe subtraction math to prevent boundary check bypasses via large memory size parameters.

Third party code
None.

Contributor Info

@dzbaker dzbaker added this to the v7.0.2 milestone Mar 9, 2026
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.

[SECURITY] DoS via Invalid Memory Access in cFS CS Application

2 participants