Post by Moe TrinFirst, let me reiterate that my C skills are virtually non-existent. I'm
reading the man page, and playing. 'Privileged options may be used in
/etc/ppp/options file or in an options file read using the call option.'
That's correct.
The part I think you're missing is that only a privileged user can
create files in the /etc/ppp/peers/ directory, and that the 'call'
option only reads files from that directory. Thus, if such a file
exists and uses the "file" option, it's already a privileged (and
safe) source of options.
The command line and any options read via occurrences of the "file"
option found there are unprivileged.
Post by Moe TrinMy expectation is that the "last" occurrence of a specific option wins.
That's true unless the source is privileged.
Post by Moe TrinLooking at the 'connect' option, it says 'A value for this option from a
privileged source cannot be overridden by a non-privileged user'. Thus, if
the 'connect' and file option are in the same source, with the file option
occurring last, it could override the connect.
No, it cannot.
The source of each option is examined. If the source is privileged,
then it can set or override the value. If the source is not
privileged, then it can set or override the value only if it has not
been set from a privileged source.
Post by Moe Trin[compton ~]$ cat /usr/local/bin/dialin7test
exec /usr/sbin/pppd connect "/usr/sbin/chat -f /etc/ppp/dialscript7" file
/tmp/foo
[compton ~]$
(Obviously, that's all one line.) /tmp/foo contained another 'connect'
option
connect "/bin/echo poo > /tmp/bar ; /bin/chown 0:0 /tmp/bar"
Both of those options are unprivileged, because they're from
unprivileged sources.
Post by Moe Trinand running dialin7test results in /usr/sbin/chat NOT running, and the
string 'poo' getting put into /tmp/bar, but the system is barfing over the
chown.
Right. See above. You haven't identified a security problem.
Also note that the connect option ('chat') is invoked as the invoking
user, not as root.
Post by Moe Trin/tmp/bar is created with ownership of the person running the
dialin7test script. This occurs with and without a '/dev/modem' line in
/etc/ppp/options, or a completely empty /etc/ppp/options file.
Yep.
Still not a problem.
Now try creating a problem. Here are two cases to try out.
Case A
/etc/ppp/options contains:
file /tmp/foo
/tmp/foo contains:
connect "chat hi there"
Then, from the command line, do this:
% pppd connect "chat no way"
You'll find that the latter (command-line) connect is ignored,
because the former is from a privileged source.
Case B
touch /etc/ppp/options
/etc/ppp/peers/bar contains:
file /tmp/blah
/tmp/blah contains:
connect "chat this works"
/tmp/flop contains:
connect "chat this does not"
Then, from the command line, try:
% pppd call bar file /tmp/flop
Post by Moe TrinPost by James CarlsonPrivileged option; non-privileged users cannot invoke this.
Understood. My concern with this option was if (for some strange reason)
root had included this option for what was seen as a legitimate reason.
If it does, then an ordinary user cannot override it.
Post by Moe TrinPost by James CarlsonThat's an incorrect analysis. Command line arguments provided by
non-root users are _NEVER_ run as root by pppd.
So it seems. None the less, the option substitution does occur. I don't
know how much further that can be taken.
Please read the documentation more carefully. Some option sources
(those that can be written directly only by an administrator) are
considered privileged. Other option sources (those that can be
changed by ordinary users) are not.
The latter cannot override the former.
This is entirely by design. Please: if you're going to make claims
about insecurity, investigate them very carefully first. It takes
only a few written words based on a flawed analysis to cause all sorts
of alarm bells to go off errantly, and to cause dozens or hundreds of
people to be forced to do unnecessary and pointless work cleaning up
the resulting mess.
--
James Carlson, KISS Network <***@sun.com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677