lix/tests
aszlig 43e28a1b75
Fix symlink leak in restricted eval mode
In EvalState::checkSourcePath, the path is checked against the list of
allowed paths first and later it's checked again *after* resolving
symlinks.

The resolving of the symlinks is done via canonPath, which also strips
out "../" and "./". However after the canonicalisation the error message
pointing out that the path is not allowed prints the symlink target in
the error message.

Even if we'd suppress the message, symlink targets could still be leaked
if the symlink target doesn't exist (in this case the error is thrown in
canonPath).

So instead, we now do canonPath() without symlink resolving first before
even checking against the list of allowed paths and then later do the
symlink resolving and checking the allowed paths again.

The first call to canonPath() should get rid of all the "../" and "./",
so in theory the only way to leak a symlink if the attacker is able to
put a symlink in one of the paths allowed by restricted evaluation mode.

For the latter I don't think this is part of the threat model, because
if the attacker can write to that path, the attack vector is even
larger.

Signed-off-by: aszlig <aszlig@nix.build>
2018-08-03 06:46:43 +02:00
..
lang lib.concatMap and lib.mapAttrs to be builtins 2018-07-05 02:54:09 +00:00
plugins Modularize config settings 2018-05-30 13:28:01 +02:00
add.sh
binary-cache.sh Don't require --fallback to recover from disappeared binary cache NARs 2018-06-05 16:04:41 +02:00
brotli.sh
build-dry.sh
build-hook.nix
build-remote.sh
case-hack.sh
case.nar
check-refs.nix
check-refs.sh
check-reqs.nix
check-reqs.sh
check.nix
check.sh
common.sh.in tests: more robust check for user namespaces availability (canUseSandbox) 2018-06-06 00:41:01 +03:00
config.nix
dependencies.builder0.sh
dependencies.builder1.sh
dependencies.builder2.sh
dependencies.nix
dependencies.sh
dump-db.sh
export-graph.nix
export-graph.sh
export.sh
fetchGit.sh
fetchMercurial.sh
fetchurl.sh
filter-source.nix
filter-source.sh
fixed.builder1.sh
fixed.builder2.sh
fixed.nix
fixed.sh
gc-concurrent.builder.sh
gc-concurrent.nix
gc-concurrent.sh
gc-concurrent2.builder.sh
gc-runtime.nix
gc-runtime.sh
gc.sh
hash-check.nix
hash.sh
import-derivation.nix
import-derivation.sh
init.sh
install-darwin.sh
lang.sh
linux-sandbox.sh
local.mk tests: test nix search behavior 2018-02-25 16:40:05 -06:00
logging.sh
misc.sh
multiple-outputs.nix
multiple-outputs.sh
nar-access.nix
nar-access.sh
nix-build.sh
nix-channel.sh
nix-copy-closure.nix
nix-profile.sh
nix-shell.sh Hardcodes nix-shell instead of /usr/bin/env nix-shell... 2018-04-09 09:36:54 -04:00
optimise-store.sh
parallel.builder.sh
parallel.nix
parallel.sh
pass-as-file.sh
placeholders.sh
plugins.sh
pure-eval.nix
pure-eval.sh
referrers.sh
remote-builds.nix
remote-store.sh
repair.sh
restricted.nix
restricted.sh Fix symlink leak in restricted eval mode 2018-08-03 06:46:43 +02:00
run.nix
run.sh
search.nix tests: test nix search behavior 2018-02-25 16:40:05 -06:00
search.sh tests/search.sh: minor fix to unbreak tests after search ux merge 2018-07-03 15:37:06 -05:00
secure-drv-outputs.nix
secure-drv-outputs.sh
setuid.nix
shell.nix Adds nix-shell test for special-cased ruby interpreter. 2018-04-08 00:45:28 -04:00
shell.shebang.rb Hardcodes nix-shell instead of /usr/bin/env nix-shell... 2018-04-09 09:36:54 -04:00
shell.shebang.sh
signing.sh
simple.builder.sh
simple.nix
simple.sh
structured-attrs.nix
structured-attrs.sh
tarball.sh
timeout.nix
timeout.sh
user-envs.builder.sh
user-envs.nix
user-envs.sh