fix: eight separate calls to strcpy() and strcat() i... in vmsmail.c#187
Conversation
Automated security fix generated by Orbis Security AI
|
The VMS servers with EvilHack could already be pwned... :( |
|
Fair 😅, I agree the practical exploitability depends heavily on whether anyone is actually running the VMS build and how exposed those servers are. I’d frame this as defensive hardening: I've adjusted the PR description so it doesn’t overstate the impact. |
|
Hey there. Yeah entrez is correct, I've never supported the VMS build, but your PR is valid, and the fixes check out. Having said that, the commit is incomplete. Same treatment could be applied to sys/vms/vmsmail.c:246 and 249-251. Maybe convert those to use snprintf(cmd_buf, sizeof cmd_buf, ...) / snprintf(txt_buf, sizeof txt_buf, ...) to match the rest of your commit. Address those and I'll merge your PR. And maybe actually see about supporting a VMS build hah. |
Convert remaining Sprintf calls in JNET send block to snprintf with sizeof bounds, as requested in PR k21971#187 review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I've made the changes to use snprintf in 2 other cases you pointed to. Hope this is good to go now. |
Summary
Replace several unbounded string copies in the OpenVMS mail/broadcast parser with bounded formatting.
Details
sys/vms/vmsmail.cbuilds display text and response commands from captured VMS mail, phone, talk, and broadcast messages using fixed-size buffers (txt_buf,cmd_buf, andnam_buf). Some paths usedstrcpy()/strcat()to append message-derived text into those buffers.Although broadcast input is already bounded, prefixes such as
"Mail for you: "or"MSG +"can cause the constructed output to exceed the destination buffer. This patch usessnprintf()consistently so long messages are truncated safely.The test-driver-only
gets()calls are also replaced withfgets().Security impact
This is defensive memory-safety hardening for VMS-specific mail/broadcast handling. Exploitability depends on VMS build configuration and whether an attacker can deliver crafted broadcast/mail/talk text to a running game process.
Changes
strcpy()/strcat()constructions withsnprintf()gets()calls withfgets()Verification
Automated security fix by OrbisAI Security