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

Denial of Service with chances of information leakage #220

Closed
dcRUSTy opened this issue Aug 8, 2020 · 4 comments
Closed

Denial of Service with chances of information leakage #220

dcRUSTy opened this issue Aug 8, 2020 · 4 comments
Labels
bug priority On priority for picking up

Comments

@dcRUSTy
Copy link
Collaborator

dcRUSTy commented Aug 8, 2020

Describe the bug
Talisman apparently follows symlinks while scanning. If a malicious git repository has symlink committed in one of the commits Say on
*nix - symlink to /dev/urandom (Infinite size file?) or /dev/random (super slow never ending file)
Windows - symlink to malicious remote SMB server

On *nix it will lead to atleast DoS as /dev/urandom is never ending?
On Windows User Credential leakage as Windows will try to login to remote SMB share with current user credentials then DoS also possible. These leaked credentials may open other portals of exploitation.

On windows it depends on value of core.symlinks in git config

To Reproduce
Steps to reproduce the behavior:

  1. Create a symlink to /dev/random . and add commit to to the repo.
  2. Run talisman -s

Expected behavior
Should not follow symlink atleast outside of repo directory( or none at all?)
On *nix - Scan should complete in finite time
On Windows - Should not connect to remote server and should complete in finite time

Screenshots
DoS_poc

it will be stuck forever

Additional context
Also applicable to precommit hooks for .talismanrc file. Again these are worst cases, highlighting core problem SYMLINKS Couldn't test all the scenarios kind of short on computational power.

@svishwanath-tw
Copy link
Collaborator

I'm thinking following symlinks to files outside the repository (eg: /dev/null) should be disregarded (not scanned) should be avoided, but following symlinks within the repo should be okay.

Any thoughts on that ?

@dcRUSTy
Copy link
Collaborator Author

dcRUSTy commented Aug 9, 2020

I also thought the same...

but then...

Symlinks inside repo which point to already committed(git added) file will lead to 1 file being scanned twice and symlinks itself cannot hold anything secret(unless somebody obfuscates secret as a path in symlink)

And following symlinks in repo may create further chances of exploitation by symlink chaining (A->B->/dev/null) or even worse (Not sure if it is posssible) (A->B->A->B->A............) where both A and B are inside repo. 😅

@dcRUSTy
Copy link
Collaborator Author

dcRUSTy commented Aug 11, 2020

Any update on this? This bug is equally serious.... Instead of
User asking Talisman to scan a Repo......
here
Repo can indirectly ask Talisman to Scan user(example - .bash_history or .zsh_history) via symlinks for secrets...

Tried reporting something similiar on talisman-maintainers@thoughtworks.com .... Has anybody received that?

@harinee harinee added the bug label Aug 11, 2020
@harinee
Copy link
Collaborator

harinee commented Aug 11, 2020

Hi @dcRUSTy thanks for this bug and the mail you sent. We acknowledge and will triage the bug.

@harinee harinee added the priority On priority for picking up label Aug 11, 2020
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 12, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 12, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 12, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
…er for ioutil.ReadFile which skips following symlink
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
dcRUSTy added a commit to dcRUSTy/talisman that referenced this issue Aug 13, 2020
…er for ioutil.ReadFile which skips following symlink
svishwanath-tw pushed a commit that referenced this issue Aug 13, 2020
…mlinks.

* [Issue #220] - dcRUSTy - Fix bug that crashed test on Windows
* [Issue #220] - dcRUSTy - Implement utility function wrapper for ioutil.ReadFile which skips following symlink
@dcRUSTy dcRUSTy closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority On priority for picking up
Projects
None yet
Development

No branches or pull requests

3 participants