Skip to content

fix: remove unsafe sprintf() in grpc-server.cpp#9486

Merged
mudler merged 1 commit into
mudler:masterfrom
orbisai0security:fix-v-001-sprintf-buffer-overflow-ik-llama-cpp
Apr 22, 2026
Merged

fix: remove unsafe sprintf() in grpc-server.cpp#9486
mudler merged 1 commit into
mudler:masterfrom
orbisai0security:fix-v-001-sprintf-buffer-overflow-ik-llama-cpp

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix critical severity security issue in backend/cpp/ik-llama-cpp/grpc-server.cpp.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File backend/cpp/ik-llama-cpp/grpc-server.cpp:329

Description: Three calls to sprintf() at lines 329, 343, and 355 in the ik-llama-cpp gRPC inference server write formatted timing and token-count statistics into a fixed-size stack buffer without specifying a maximum output length. The sprintf() function does not enforce any buffer size limit. If the formatted output — including large numeric values for token counts or timing measurements — exceeds the allocated stack buffer size, the overflow will overwrite adjacent stack memory including return addresses and saved frame pointers, enabling potential arbitrary code execution.

Changes

  • backend/cpp/ik-llama-cpp/grpc-server.cpp

Verification

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

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
@mudler mudler changed the title fix: remove unsafe exec() in grpc-server.cpp fix: remove unsafe sprintf() in grpc-server.cpp Apr 22, 2026
@mudler mudler merged commit bbeacf1 into mudler:master Apr 22, 2026
38 checks passed
@localai-bot localai-bot added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants