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 issues in zshenv #9

Open
Daudre-Vignier-Charles opened this issue Aug 17, 2018 · 2 comments
Open

Security issues in zshenv #9

Daudre-Vignier-Charles opened this issue Aug 17, 2018 · 2 comments
Labels
enhancement New feature or request Security Issue

Comments

@Daudre-Vignier-Charles
Copy link
Owner

Do not use an eval, all tests must be hardcoded using an case/esac structure:

  • better control on runtime - easiest debug

Security issue using eval for unnitests : Running unnitest may conduct to an arbitrary code execution.

@Daudre-Vignier-Charles
Copy link
Owner Author

Daudre-Vignier-Charles commented Aug 28, 2018

Template :

unnitest(){
    typeset -a allTests
    while read oneTest ; do
        allTests+=($oneTest)
    done
   [[ "$1" == "{" ]]
}
alias ztest-block='unnitest<<"}"'

@Daudre-Vignier-Charles
Copy link
Owner Author

Daudre-Vignier-Charles commented Aug 29, 2018

Internal test block template :

1. $NAME {$ARGS} return "$INT"
2. $NAME {$ARGS} output  $TEST "$CONDITION"
3. $NAME {$ARGS} error $TEST "$CONDITION"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Security Issue
Projects
None yet
Development

No branches or pull requests

1 participant