Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security concerns with the GH_TOKEN #7747

Closed
mleister97 opened this issue Aug 29, 2023 · 4 comments
Closed

Security concerns with the GH_TOKEN #7747

mleister97 opened this issue Aug 29, 2023 · 4 comments
Labels

Comments

@mleister97
Copy link

I would really like to draw attention to this issue & reopen it again

#5688

Currently, it is not possible to use different keys/tokens for publishing and reading private repositories, except by manually modifying the token using the setFeedURL function. For security reasons, I kindly request you to reopen the issue.

@mleister97
Copy link
Author

mleister97 commented Aug 29, 2023

For everyone who is interested, this is currently the only way to use 2 different tokens:

    autoUpdater.setFeedURL({
      provider: 'github',
      repo: 'xxx',
      owner: 'xxx',
      private: true,
      token: 'read_token',
    });

.env

GH_TOKEN=publish_token

package.json
Do not include any tokens here!

"scripts": {
  "deploy": "ts-node ./.erb/scripts/clean.js dist && npm run build && dotenv -- electron-builder build --publish always",
},
...
"build": {
  ...,
  "win": {
   ...,
  "publish": {
        "provider": "github",
        "repo": "xxx",
        "owner": "xxx",
        "private": true,
        "channel": "latest",
        "releaseType": "release"
      }
  }
}

Attention: This key can read any repositoriers in your account as this is an personal access token.

READ-TOKEN
image

WRITE-TOKEN
image

@NordlingDev
Copy link

NordlingDev commented Sep 19, 2023

@mleister97 I'm concerned about the exposure of token in client side code, even if it's a read only token. You explicitly set the token inside your client basically. Doesn't matter if it's in an env variable or not, the final bundle will still contain the token. So anyone can go through the file and find the token, right?

I can't think of any workaround either... Is there really no other way to do it?

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 19, 2023
Copy link
Contributor

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants