Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Fix command injection in link handler
Browse files Browse the repository at this point in the history
  • Loading branch information
maple3142 authored Jun 19, 2023
1 parent 723a9e4 commit 38e57d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/base/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class AppEvents {
console.log("token: ", authURI.split("lastfm?token=")[1]);
utils
.getWindow()
.webContents.executeJavaScript(`ipcRenderer.send('lastfm:auth', "${authURI.split("lastfm?token=")[1]}")`)
.webContents.executeJavaScript(`ipcRenderer.send('lastfm:auth', ${JSON.stringify(authURI.split("lastfm?token=")[1])})`)
.catch(console.error);
}
} else if (arg.includes("playpause")) {
Expand Down Expand Up @@ -220,7 +220,7 @@ export class AppEvents {
} else if (arg.includes("/beep")) {
shell.beep();
} else {
utils.getWindow().webContents.executeJavaScript(`app.appRoute('${arg.split("//")[1]}')`);
utils.getWindow().webContents.executeJavaScript(`app.appRoute(${JSON.stringify(arg.split("//")[1])})`);
}
}

Expand Down

0 comments on commit 38e57d5

Please sign in to comment.