Skip to content

v4.3.5

Choose a tag to compare

@bvisible bvisible released this 25 Nov 08:42
· 17 commits to main since this release

A security release: upgrade if a server uses restricted or readonly mode. A
command a DENY_PATTERNS entry (or the readonly list) names could still run behind an
allowed launcher such as find -exec or xargs, because the shell rewrites a word
before it runs it
(GHSA-4fp4-fggm-cf5c,
high). Every release from 3.5.0, where the security modes were added, is affected.
Two things behave differently on purpose: restricted mode now refuses $_,
brace expansions and a command whose own name has a quote, a backslash, a variable
or a glob; readonly mode refuses $_ and reads a name after /bin/ or /sbin/, so
ls -l /usr/bin/su is refused there (details below). Nothing else changes (the release pipeline upgrades 3.8.5,
3.8.6, 3.8.7, every 4.0.x, 4.1.0, 4.2.0, 4.3.0, 4.3.1, 4.3.2, 4.3.3 and 4.3.4 from the
registry to this version and back).

The Windows installer is still not Authenticode-signed, for the same reason
as 4.0.0: Windows shows "Windows protected your PC", More info → Run anyway,
and ssh-manager app checks the installer against the SHA-256 in
release-manifest-win32.json. macOS builds are signed and notarized.

Security

  • A command a DENY_PATTERNS entry names could still run, behind an allowed
    launcher
    (GHSA-4fp4-fggm-cf5c,
    reported by Pythame). The patterns, and the built-in list of readonly, were
    tested on the text as typed, and a shell does not run that text: r\<newline>m,
    r${x}m (x unset), r""m, r\m and "r"m are all rm. With ^find allowed and
    \brm\b denied, find . -exec r""m -rf x {} + was allowed and deleted the target.
    Every command is now also tested as the shell reads it: quotes, backslashes and
    line continuations removed, variables read as unset and as blanks, ${x:-word} as
    its word, braces expanded, and the name of the command without its directory.
    Found with a differential check against sh, dash, bash, ksh and zsh (1,500 random
    spellings of rm behind find, xargs and env), which is now part of the tests.
  • Fixed alongside: /usr/bin/rm and find -exec /bin/rm were not seen by the
    readonly list; a command name written with a quote or a variable (ls""x) matched
    an allow pattern for another name than the one the shell ran.

Changed

  • restricted mode now refuses what a line can use to spell a name: $_,
    brace expansions ({a,b}, {1..3}) and a command whose own name has a quote,
    a backslash, a variable or a glob ("ls" -l, \ls). Arguments are not affected
    (ls "/var/log", echo $HOME, find . -name "*.log").
  • readonly mode refuses $_, and reads a name after /bin/ or /sbin/:
    ls -l /usr/bin/su is now refused. A quoted argument is still an argument
    (grep "kill -9" /var/log/syslog runs); a quoted command name is not ("rm" -rf x).
  • A glob or an interpreter is still out of reach of a deny pattern. The security
    modes document lists what an allow pattern should not admit.

Install or update: npm install -g mcp-ssh-manager@4.3.5 (or npm update -g mcp-ssh-manager), or download the desktop application below; the 4.x application updates itself.