exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

perforce.txt

perforce.txt
Posted Jan 4, 2007
Authored by Ben Bucksch | Site bucksch.org

It appears that the Perforce client/server model is a bit broken. The client appears to give the server full control over the machine of the client. This,.. is not happiness.

tags | advisory
SHA-256 | ae2ad23b5ef08618c4d5984a4280734db24c2ba34bd13a8862f0e473ec52a11c

perforce.txt

Change Mirror Download
= Abstract =

The Perforce client has a huge gapping security hole by design. It
totally trusts the Perforce server and does whatever the server tells
it, writing arbitrary files.

= Disclaimer =

This is so terribly obvious that I'd be surprised that this is news, but
I couldn't find anything. Or I'm missing something.

= Problem =

The Perforce server stores a "client config", which contains the local
pathnames on the *client* machine (the machine fetching source). Of
course, that information on the server can change any time. The problem
is: the Perforce client adheres to it without a second thought. That
means the p4 server can tell the p4 client to overwrite my ~/.bashrc,
and *it will just do it*.

In fact, the client cannot even do "p4 help" on its own, even that comes
from the server. Apparently, there is a very fundamental design problem
of overly relying on the server, nor checking its input, there are
probably more bugs of this kind. I am completely new to Perforce, so the
"p4 sync" problem described above may well not be the only one.

= Reproduction =

1. Let your Perforce admin set up your client workspace, and in it
"/tmp/foo/" as local directory name.
2. Get the Linux commandline client from perforce.com
3. Do
cd /usr/src/
P4CLIENT=your-client-workspace-name P4PORT=servername:port p4 sync
4. p4 will write files to /tmp/foo/ instead of /usr/src/.


= Risk =

Critical. The server has full access to *all* files that *any* of its
users has.

"We can trust the server" is not an appropriate answer:

* I am a contractor and have access to many companies' sources, and
I do *not* allow any company I work for to have full access to all
files on my computer, including the source of the all other
companies I work for and even personal files.
* Also, there are many ways to fool DNS, so that your client goes to
another, hostile server.
* And, lastly, a server is not 100% bulletproof either.


= Versions affected =

Probably all affected.

= Vendor notification =

Vendor has not been given secret advance notification, due to the nature
of the bug.

= Proposed fix =

The problem at hand could be easily fixed by letting the client check
out only in the current directory (or one specified by the user on the
commandline or GUI, preferences stored locally), no matter what the
server says. It may put files anywhere underneath that directory, but
never higher or otherwise outside. It must never adhere to absolute
paths from the server. This does require some changes to how client
specs work, though.

But to believe that this would fix the client would be naive. The nature
of the bug, that this is a design problem, and a terribly obvious one at
that, points to a very serious attitude problem, that there's no
consideration for security at all (when it comes to client vs. server).
This usually reflects in many places in the design and code and is often
very hard or impossible to remove, because this often results in
hundreds or thousands of security holes. I've seen code with critical
security holes on every third line, for similar reasons. Thus, the only
way that Perforce could reassure the security of the client vs. server
would be to make the client source open for review (preferably as Open
Source) and make the protocol available for everybody to implement their
own clients.


Ben Bucksch
http://www.bucksch.org
Emails please to firstname.lastname@beonex.com, sorry for the inconvenience

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close