asciinema / asciinema

Terminal session recorder 📹

Home Page:https://asciinema.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't leak host, username and current working directory

vwkd opened this issue · comments

commented

Describe the bug

Currently, asciinema recordings include the host, username and current working directory in the .cast file. Here's an example line:

[0.034247, "o", "\u001b]1337;RemoteHost=vwkd@Mac.local\u0007\u001b]1337;CurrentDir=/Users/vwkd/foo/bar\u0007"]

This information isn't visible when playing the .cast file.

This is a privacy concern. Without reading the raw .cast file, users don't know that they share their host, username and current working directory and might leak unintended information.

To Reproduce

  1. Record a .cast file locally.
  2. Open the .cast file in a text editor.
  3. Search for your host, username, or current working directory.

Expected behavior
Replace host, username and current working directory with a placeholder. When replaying, the player can fill in the current host, username and current working directory.

Versions:

  • OS: macOS 14.1
  • asciinema cli: 2.4.0

Additional context

Hi,

This information is produced by your shell (or some program running in it), written to stdout, therefore it's captured by asciinema like every other write performed by your shell.

The reason it's not visible is this information is part of an escape sequence, and those are used to control terminal (e.g. change color) instead of printing.

If you don't want this to be recorded then I suggest to check your shell/terminal configuration and make it not print it in the first place.

asciinema doesn't explicitly collect this information, it just captures the whole output stream. It works in the same way as other terminal recording programs like ttyrec, termrec or unix script command.

commented

Thanks for the detailed explanation and happy to hear asciinema doesn't cause this.