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

Remote Code Execution #687

Open
devast8a opened this Issue May 22, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@devast8a

By default, any application that writes untrusted data to the terminal without filtering for ANSI escape sequences is vulnerable to remote code execution when running under ConEmu. This is done by using the fact that ConEmu has a special OSC for executing programs ESC ] 9; 7; prog ST.

To mitigate this you can disable Injecting ConEmuHk and ensure your process isn't directly run by ConEmu. However this may not be desirable as you lose other functionality.

A possible change to deal with this could be to add an option that by default disables ConEmu OSC handling.

Even though ConEmu isn't really to blame, applications should be filtering untrusted data, in practice the default behavior is unsafe.

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 May 22, 2016

Owner

Actually, I'm planning to implement list of allowed commands (using masks or regexps).

Owner

Maximus5 commented May 22, 2016

Actually, I'm planning to implement list of allowed commands (using masks or regexps).

Maximus5 added a commit that referenced this issue Jun 9, 2016

gh-687: Settings page ‘Integration’ -> ‘ANSI execution’ to control al…
…lowed code and macro.

  This allows [ConEmu specific OSC](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC)
  to be executed: `^]]9;6;""*macro*""^]\\` and `^]]9;7;""*cmd*""^]\\`.

  Since now, they allowed by default in `cmd.exe` only (were implemented for `GitShowBranch.cmd`).
  User may also disable or enable they for any process.

  Also, there is a list of allowed commands. Commands are case-sensitive, one line - one command.
  User may use `*` to allow bunch of commands by ‘mask’.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment