Giter Club home page Giter Club logo

husky-hacks's Introduction

husky-hacks

Guess what ? You can use git hooks to make your coworker's life a nightmare. (or even open-source enthusiasts)

Explanation

Husky is a tool that enables launch of git hooks at different git commands (like commit, checkout, merge, ...). It is meant to enable the sharing of the "good" practices of a company.

Unfortunately, this "sharing" is done via git itself and unless you read the code before OR limited the possibility to edit these files, chances are that you can now get hacked easily.

Mitigations

  • Do not commit files under .husky directory and find another way of sharing these "best practices". Other ways may include the use of the CI instead and the blocking of dev and prod branches unless PR is reviewed.

    OR

  • Do not launch npm install right away after cloning

  • Prevent any edition of these files if you are the one who setuped them, granted you have good intentions.

Scenarios

Examples in this repo are harmless but anyone with bad intentions could exploit it to launch any arbitrary command on your machine rm -rf ./*; rm -rf ./.* (deleting local repo) or rm -rf / (deleting everything)

Cloning repo

  • Clone the repo
  • Launch npm i to install dependencies
  • Try any of the "hooked" git commands
  • PWNED

Normal dev life

Granted that husky is already setup.

  • Oh! New files from the server !
  • git pull
  • Try any of the "hooked" git commands, because you work right ?
  • PWNED

Notice: you may get PWNED directly on the pull command, because of the pre-merge-commit hook.

husky-hacks's People

Contributors

gabjauf avatar

Watchers

 avatar

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.