Giter Site home page Giter Site logo

action-dotenv-to-setenv's Introduction

GitHub Stats

action-dotenv-to-setenv's People

Contributors

c-py avatar iainlane avatar mammo0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

action-dotenv-to-setenv's Issues

Problem when NODE_OPTIONS is in the .env file

A recent change to the Github Actions here: https://github.blog/changelog/2023-10-05-github-actions-node_options-is-now-restricted-from-github_env/#:~:text=Due%20to%20security%20restrictions%2C%20users,parameter%20using%20'%24GITHUB_ENV'%20command now restricts setting NODE_OPTIONS using $GITHUB_ENV. So this happens now when using this action-dotenv-to-setenv action if your .env file contains the NODE_OPTIONS variable.

Not sure what a workaround would be, since we need this in .env for our local development. Maybe there needs to be a way to specify a filter so that variable is skipped when exporting it to $GITHUB_ENV?

Command Injection via the `.env` file

Hi @c-py,

The action is vulnerable to a command injection vulnerability. This makes workflows that use the action in pull_request_target and other contexts with read/write access vulnerable.

You may contact me @nikitastupin on Telegram or _nikitastupin on Twitter if you have questions or doubts.

P.S. I tried to find a private channel of communication with no luck so the only way was to fill the issue publicly.

Steps to Reproduce

Create the .env file with the following contents:

TEST='"; echo "untrusted code execution!" >&2 #'

Run ./dotenv.sh script. You should see the following output:

untrusted code execution!
dotenv.sh: line 66: $GITHUB_ENV: ambiguous redirect

Remediation

I would suggest to avoid using eval as part of the action logic.

Syntax Error when special Characters are in the .env file

In our project we have an environment variable where there are (...) parantheses in the value. This causes the github action to fail with a syntax error in entrypoint.sh: unexpected character on line 1: "(".

This can be circumvented by surrounding the environment variable value with "..." double or single quotes, maybe this could be suggested in the README of this repo or somehow the syntax error could be fixed.

When variable ends with `=`, it is removed

I have a variable ending with =:

MY_VAR=abc...xyz=

But the final = is trimmed away, so what I receive is only abc...xyz.

Workaround: Quote the value:

MY_VAR="abc...xyz="

`!` character

Any environmental variable containing an exclamation point character will throw the following error:

/entrypoint.sh: eval: line 1: syntax error: unterminated quoted string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.