Skip to content

fix(security): 2 improvements across 1 files - #117

Open
tomaioo wants to merge 1 commit into
inclusionAI:mainfrom
tomaioo:fix/security/format-string-vulnerability-in-check-mac
Open

fix(security): 2 improvements across 1 files#117
tomaioo wants to merge 1 commit into
inclusionAI:mainfrom
tomaioo:fix/security/format-string-vulnerability-in-check-mac

Conversation

@tomaioo

@tomaioo tomaioo commented Aug 4, 2026

Copy link
Copy Markdown

Summary

fix(security): 2 improvements across 1 files

Problem

Severity: High | File: csrc/kda/sm90/utils/common.hpp:L22

The CHECK macro in common.hpp uses sprintf with a format string constructed from user-provided arguments (msg). If msg contains format specifiers (e.g., %s, %x), it will lead to a format string vulnerability, potentially crashing the process or leaking memory contents.

Solution

Use snprintf and explicitly pass a literal format string to prevent format string attacks. For example: snprintf(buffer.data(), buffer.size(), "Failed to check %s, %s at %s:%d\n", #expr, msg, __FILE__, __LINE__);

Changes

  • csrc/kda/sm90/utils/common.hpp (modified)

- Security: Format String Vulnerability in CHECK Macro
- Security: Potential Buffer Overflow in CUDA_CHECK Macro

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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