Skip to content

Fix Path/Directory Traversal and useridLength#950

Merged
Rajat-0 merged 1 commit into
openmainframeproject:masterfrom
Raghavisatish:sast_issue
Jun 10, 2026
Merged

Fix Path/Directory Traversal and useridLength#950
Rajat-0 merged 1 commit into
openmainframeproject:masterfrom
Raghavisatish:sast_issue

Conversation

@Raghavisatish

Copy link
Copy Markdown
Contributor
  1. SECURITY FIX: Validate useridLength to prevent Loop DoS and buffer overflow
  • VM userids in z/VM are maximum 8 characters
  • cacheUserID buffer is only 9 bytes (8 + 1 for null terminator) ----> char cacheUserID[ 8 + 1 ];

Without this check, an attacker could:

  • Send useridLength=0xFFFFFFFF causing the below for loop to run billions of times (Loop DoS)
  • Send useridLength>8 causing buffer overflow in cacheUserID
                for (x = 0; x < useridLength; ++x) {
                    cacheUserID[x] = tolower(userid[x]);
                }
  1. Fix Path/Directory Traversal to prevents attacks like "/valid/path/../../../etc

Signed-off-by: Raghavisatish <raghavisatish24@gmail.com>
@Rajat-0 Rajat-0 requested a review from Bischoff June 8, 2026 16:19
@Rajat-0 Rajat-0 merged commit a39b649 into openmainframeproject:master Jun 10, 2026
2 checks passed
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.

3 participants