Subject: pkg/23048: pkg_install fails to ensure integrity of symbolic links
To: None <>
From: Klaus Klein <>
List: netbsd-bugs
Date: 10/03/2003 21:47:34
>Number:         23048
>Category:       pkg
>Synopsis:       pkg_install fails to ensure integrity of symbolic links
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 03 19:49:00 UTC 2003
>Originator:     Klaus Klein
>Release:        NetBSD 1.6ZC
Frobozz Magic Standards Company

	pkg_install does not ensure the integrity of symbolic links;
	this is a bit surprising since it does, on the other hand,
	record digests of regular files installed.

	Consider the following (arbitrarily chosen) scenario:

	lrwxr-xr-x [...] lib/ ->
	lrwxr-xr-x [...] lib/ ->
	-rwxr-xr-x [...] lib/

	This results in the following packaging list fragment:

	@comment MD5:b3939cd72cd6d481f0f7f18b5f740245

	That is, only the regular file has an integrity record.
	Now, consider dynamic linking characteristics:

	$ ldd bin/recode
		 -lintl.0 => /usr/lib/
		 -lrecode.0 => /usr/pkg/lib/
		 -lc.12 => /usr/lib/

	It sufficient to compromise the unprotected symbolic link
	in order compromise applications depending its original,
	integrity-checked target.


	Create a record of symbolic links' targets.  In terms of simplicity,
	creating a new packaging list directive for symbolic links seems
	attractive, which would also have the advantage of marking them
	distinct from regular files in an obvious way.

	An alternative approach could be to record the link target in a
	comment directive similar to the current MD5 comment record.