Skip to content

fix: allow prompt string with special characters - #9

Merged
Tohrusky merged 2 commits into
EutropicAI:mainfrom
TohruskyDev:main
Feb 16, 2026
Merged

fix: allow prompt string with special characters#9
Tohrusky merged 2 commits into
EutropicAI:mainfrom
TohruskyDev:main

Conversation

@Tohrusky

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @Tohrusky, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a specific issue related to command execution by adjusting the spawn process configuration. By disabling the shell, the application can now reliably process and execute commands that include prompt strings with special characters, thereby enhancing the robustness and compatibility of external process interactions.

Highlights

  • Process Execution Configuration: Modified the spawn function call to explicitly set shell: false when executing zImageChild. This change is crucial for correctly handling prompt strings that contain special characters, preventing potential issues during command execution.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/zimage.ts
    • Changed the shell option in the spawn function call from true to false to allow prompt strings with special characters.
Activity
  • No activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a critical command injection vulnerability by setting the shell option to false in the spawn call. This is a crucial security fix that prevents malicious user input in prompts from executing arbitrary shell commands. I've added one suggestion to improve the inline comment to make the security implication of this change clearer for future maintainers.

Comment thread src/main/zimage.ts Outdated
@Tohrusky

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a critical security fix by setting shell: false when spawning the zImage process, effectively preventing command injection vulnerabilities. While this addresses one critical issue, a high-severity path traversal vulnerability was identified in how model and output paths are constructed from IPC-supplied options. It is crucial to validate that these paths do not escape their intended base directories. Additionally, although the model property is now required in the ZImageOptions interface, it is recommended to implement backend validation to ensure the model name is not an empty string, rather than relying solely on frontend validation, to enhance robustness.

Comment thread src/main/zimage.ts
Comment on lines +135 to +136
const modelPath = join(options.modelDir, options.model)
args.push('-m', normalize(modelPath))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

A high-severity path traversal vulnerability exists here: the modelPath is constructed using options.modelDir and options.model from the renderer process without sufficient validation. This allows for path traversal (e.g., using ../../ sequences) leading to arbitrary file access, even with normalize. It's crucial to validate that the resolved path remains within its intended base directory. Additionally, while model is required in ZImageOptions, it could still be an empty string. Backend validation is needed to ensure options.model is a non-empty string to prevent an invalid -m argument.

Suggested change
const modelPath = join(options.modelDir, options.model)
args.push('-m', normalize(modelPath))
const modelPath = join(options.modelDir, options.model)
const normalizedModelPath = normalize(modelPath)
if (!normalizedModelPath.startsWith(normalize(options.modelDir))) {
throw new Error('Invalid model path')
}
args.push('-m', normalizedModelPath)

@Tohrusky
Tohrusky merged commit 1fbc2e5 into EutropicAI:main Feb 16, 2026
6 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.

1 participant