Skip to content

Conversation

rzr
Copy link
Owner

@rzr rzr commented May 26, 2025

Potential fix for https://github.com/rzr/z-wave-protocol-controller/security/code-scanning/7

To fix the issue, we need to check the return value of each snprintf call to ensure it is within the bounds of the remaining buffer size. If the return value is negative (indicating an encoding error) or exceeds the remaining buffer size, we should stop further writes to the buffer to prevent overflows. This involves modifying all snprintf calls in the affected functions (zwapi_demo_application_handler and zwapi_demo_application_controller_update) to include these checks.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

rzr and others added 2 commits May 26, 2025 16:51
This issue was reported by CodeQL, IMHOI the alert was over reacting
because contents was already extracted in a separate directory (which
is absent in tree, so there is no risk to override)

An extra check would be to verify a signed asset (using GPG),
along a ZWA public key shared in tree.

Potential fix for code scanning alert no. 1: Artifact poisoning

Origin: SiliconLabsSoftware#108
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Relate-to: Z-Wave-Alliance/OSWG#48 (comment)
Relate-to: SiliconLabsSoftware#67
Relate-to: https://github.com/rzr/z-wave-protocol-controller/security/code-scanning/1
Relate-to: https://cwe.mitre.org/data/definitions/829.html
Releta-to: SiliconLabsSoftware#100
Signed-off-by: Philippe Coval <[email protected]>
…call to snprintf

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rzr rzr force-pushed the main branch 11 times, most recently from 02155b9 to c1e7488 Compare June 2, 2025 15:17
@rzr rzr force-pushed the main branch 10 times, most recently from e7c64e2 to a86e78d Compare June 5, 2025 15:37
@rzr rzr force-pushed the main branch 7 times, most recently from f24e8cf to 8787f76 Compare June 16, 2025 14:09
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