Skip to content

fix(security): 2 improvements across 2 files#4467

Open
tomaioo wants to merge 2 commits into
nasa:masterfrom
tomaioo:fix/security/potential-command-injection-via-graphql-
Open

fix(security): 2 improvements across 2 files#4467
tomaioo wants to merge 2 commits into
nasa:masterfrom
tomaioo:fix/security/potential-command-injection-via-graphql-

Conversation

@tomaioo

@tomaioo tomaioo commented May 23, 2026

Copy link
Copy Markdown

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: Medium | File: bamboo/detect-pr.js:L10

In bamboo/detect-pr.js, user-controlled input from process.argv is directly interpolated into a GraphQL query string without sanitization. While this is in a build script context, the headRefName and baseRefName values are embedded directly into the GraphQL template literal, which could lead to injection if malicious branch names are provided.

Solution

Use GraphQL variables instead of string interpolation for dynamic values. Pass headRefName and baseRefName as variables in the request payload rather than embedding them in the query string.

Changes

  • bamboo/detect-pr.js (modified)
  • packages/api-client/src/cumulusApiClient.ts (modified)

tomaioo added 2 commits May 22, 2026 17:15
- Security: Potential Command Injection via GraphQL Query Construction
- Security: Unsafe JSON Parsing without Validation

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Potential Command Injection via GraphQL Query Construction
- Security: Unsafe JSON Parsing without Validation

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants