Skip to content

plugin: use snprintf for fixed-size formatting buffers#3352

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
orbisai0security:fix-sprintf-buffer-overflow-plugin-c
May 13, 2026
Merged

plugin: use snprintf for fixed-size formatting buffers#3352
igaw merged 1 commit into
linux-nvme:masterfrom
orbisai0security:fix-sprintf-buffer-overflow-plugin-c

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

@orbisai0security orbisai0security commented May 12, 2026

Summary

plugin: use snprintf for fixed-size formatting buffers

Replace sprintf() with snprintf() when formatting strings into the fixed-size man and usage buffers in plugin.c.

The inputs are currently internal command/plugin metadata and are expected to be short, so this is not believed to be a practical security vulnerability. This change is a defensive cleanup that makes the bounds explicit and avoids relying on those assumptions.

Changes

  • plugin.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 12, 2026

The commit message doesn't match what the patch does. Please update the commit message accordingly. The change itself is okay though highly unlikely that this is ever a problem. The strings are fixed and relative short. But yes, famous last words.

@orbisai0security orbisai0security changed the title fix: remove unsafe exec() in plugin.c plugin: use snprintf for fixed-size formatting buffers May 13, 2026
@orbisai0security
Copy link
Copy Markdown
Contributor Author

Updated the title/description to reflect the actual code changes.

@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

Thanks. I was referring to the commit message itself, not the github title. The reason I asked this, we don't know how log github will exists (whatever reason this repo moves away), thus the git history is very important and should contain all necessary information to understand what a change does. Currently, it reads

fix: V-001 security vulnerability

Automated security fix generated by Orbis Security AI

SoB: ...

I would suggest to change to something like

plugin: use snprintf for fixed-size formatting buffers

Automated security fix generated by Orbis Security AI

SoB:...

I can do it myself if you want. Just wanted to inform you why I am asking this.

Automated security fix generated by Orbis Security AI

Signed-off-by: orbisai0security <mediratta01.pally@gmail.com>
@orbisai0security orbisai0security force-pushed the fix-sprintf-buffer-overflow-plugin-c branch from 89afbe7 to 2e4677f Compare May 13, 2026 08:17
@orbisai0security
Copy link
Copy Markdown
Contributor Author

Thanks. I was referring to the commit message itself, not the github title. The reason I asked this, we don't know how log github will exists (whatever reason this repo moves away), thus the git history is very important and should contain all necessary information to understand what a change does. Currently, it reads

fix: V-001 security vulnerability

Automated security fix generated by Orbis Security AI

SoB: ...

I would suggest to change to something like

plugin: use snprintf for fixed-size formatting buffers

Automated security fix generated by Orbis Security AI

SoB:...

I can do it myself if you want. Just wanted to inform you why I am asking this.

done

@igaw igaw merged commit 9fdba05 into linux-nvme:master May 13, 2026
28 of 29 checks passed
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented May 13, 2026

Thanks!

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