Skip to content

fix: remove unsafe exec() in display_task.c#310

Merged
ruvnet merged 1 commit intoruvnet:mainfrom
orbisai0security:fix-v002-display-buffer-uaf
Apr 3, 2026
Merged

fix: remove unsafe exec() in display_task.c#310
ruvnet merged 1 commit intoruvnet:mainfrom
orbisai0security:fix-v002-display-buffer-uaf

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix high severity security issue in firmware/esp32-csi-node/main/display_task.c.

Vulnerability

Field Value
ID V-002
Severity HIGH
Scanner multi_agent_ai
Rule V-002
File firmware/esp32-csi-node/main/display_task.c:116

Description: Display buffer allocation error handling frees buf1 and buf2 pointers but does not set them to NULL. If display_task continues execution or is called again, these dangling pointers may be dereferen...

Changes

  • firmware/esp32-csi-node/main/display_task.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • Code review passed

Automated security fix by OrbisAI Security

Display buffer allocation error handling frees buf1 and buf2 pointers but does not set them to NULL
Resolves V-002
Copy link
Copy Markdown
Owner

@ruvnet ruvnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #310

Recommendation: MERGE (with note)

Summary

This PR (from OrbisAI Security) fixes V-002: a use-after-free risk in display_task.c where buf1/buf2 are freed but not set to NULL in the error path. The fix adds = NULL after each free().

Security Assessment

  • Fix is correct: Setting freed pointers to NULL prevents use-after-free if the function is re-entered or execution continues past the error path.
  • Scope is minimal: 8 lines added, 2 removed — single file, single function. Low regression risk.
  • No new attack surface introduced.

Conflict Assessment (ADR-069 through ADR-078)

  • No conflicts. Our recent ADR-069 work (a4bd2308b) touched edge_processing.c and csi_collector.c, not display_task.c. The LVGL buffer allocation code has not changed since the original implementation.

Minor Notes

  • The function still returns ESP_OK after a failed allocation (line unchanged). This is pre-existing behavior — the display is optional and failure is non-fatal. Not a blocker for this PR, but worth a follow-up to return ESP_ERR_NO_MEM instead.

Verdict: Clean security fix. Safe to merge.

@ruvnet ruvnet merged commit 430243c into ruvnet:main Apr 3, 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.

2 participants