fix(cli): prevent malformed tauri.conf.json from unsanitized user input#15645
Open
ramsesndame237 wants to merge 1 commit into
Open
fix(cli): prevent malformed tauri.conf.json from unsanitized user input#15645ramsesndame237 wants to merge 1 commit into
ramsesndame237 wants to merge 1 commit into
Conversation
d63f2a6 to
e624f21
Compare
Contributor
Package Changes Through e624f21There are 12 changes which include tauri with minor, tauri-build with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-cli with minor, tauri-macos-sign with minor, tauri-bundler with minor, tauri-driver with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15635
for the fix i reproduice the error localy on my windows 11 machine


the error show me that is en sanitazation the problem the double quote of the name interupted the read of the json because the title was ""title_name"" and in a json is a bad write is you don't echaped the caracter so i propose a correction were i strip the surrounding quotes from every prompt answer before it gets used, and i also escape the user input properly when it's injected into tauri.conf.json, so special characters like quotes, backslashes or newlines can no longer break the generated file. i also added a basic validation for the dev server url, and removed the unwrap() calls that were parsing the generated config, replacing them with proper error handling so a bad value gives a clear error instead of crashing the cli. And is working