Bug 13526

Summary: PCF font parser vulnerability
Product: xorg Reporter: Matthieu Herrb <matthieu.herrb>
Component: SecurityAssignee: X.Org Security <xorg_security>
Status: RESOLVED FIXED QA Contact: X.Org Security <xorg_security>
Severity: normal    
Priority: medium CC: alan.coopersmith, bressers, jcristau, sndirsch
Version: 7.3 (2007.09)   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
cert vulnerability report
none
POC PCF file
none
patch from Alan - xserver part
none
patch from Alan - libXfont part none

Description Matthieu Herrb 2007-12-04 13:18:32 UTC
The US CERT has notified us of a vulnerability in the PCF font parser.
Comment 1 Matthieu Herrb 2007-12-04 13:22:17 UTC
Created attachment 12946 [details]
cert vulnerability report
Comment 2 Matthieu Herrb 2007-12-04 13:23:44 UTC
Created attachment 12947 [details]
POC PCF file
Comment 3 Alan Coopersmith 2007-12-17 11:05:34 UTC
Any proposed fix for this yet?   Are we planning on releasing on January 8 with
the iDefense fixes?
Comment 4 Matthieu Herrb 2007-12-17 12:48:56 UTC
The original report contains some hints on how to fix that, 
but I haven't got to implement them yet.

If possible yes, I'd like to release this on January 8, with the others fixes for the issues reported by iDefense. 
Comment 5 Julien Cristau 2008-01-06 09:06:44 UTC
has a CVE id been assigned for this?

Thanks,
Julien
Comment 6 Matthieu Herrb 2008-01-07 00:31:22 UTC
(In reply to comment #5)
> has a CVE id been assigned for this?
> 
Not as far as I know.
Comment 7 Adam Jackson 2008-01-07 09:53:15 UTC
As there's no patch yet, I would suggest that this shouldn't be included in the mass unembargo tomorrow.
Comment 8 Matthieu Herrb 2008-01-07 09:55:49 UTC
(In reply to comment #7)
> As there's no patch yet, I would suggest that this shouldn't be included in the
> mass unembargo tomorrow.
> 

The unembargo date has been postponed by one week. Are xorg_security@ messages stuck again?

And yes, there's a patch for this, I just forgot to attach it here. 
Comment 9 Matthieu Herrb 2008-01-08 00:51:05 UTC
Created attachment 13582 [details] [review]
patch from Alan - xserver part
Comment 10 Matthieu Herrb 2008-01-08 00:52:30 UTC
Created attachment 13583 [details] [review]
patch from Alan - libXfont part
Comment 11 Adam Jackson 2008-01-08 13:15:42 UTC
Does this issue have a CVE yet?
Comment 12 Matthieu Herrb 2008-01-08 14:03:31 UTC
(In reply to comment #11)
> Does this issue have a CVE yet?
> 

No. And I realized by re-checking my log for this bug that I never got any ack from CERT for the release date. So it will need to be separated from the other bugs.
I've asked them again.
Comment 13 Adam Jackson 2008-01-09 08:49:58 UTC
We'd really prefer to do them all at once.  And given that the patch in comment #9 looks like a unified patch for _all_ the outstanding issues, and that you seem to have attributed it to Alan, I suspect at least one other vendor wants them all done at once too.

My security goons tell me we can get a CVE ID pretty quickly, let me know if you want us to take that up.
Comment 14 Alan Coopersmith 2008-01-09 08:59:00 UTC
We'd prefer one release for all too.   And while I forwarded the patch to 
xorg_security, it was developed for us by Jeremy Uejio in our sustaining team.
Comment 15 Matthieu Herrb 2008-01-09 13:41:58 UTC
(In reply to comment #13)
> We'd really prefer to do them all at once.  And given that the patch in comment
> #9 looks like a unified patch for _all_ the outstanding issues, and that you
> seem to have attributed it to Alan, I suspect at least one other vendor wants
> them all done at once too.
> 
> My security goons tell me we can get a CVE ID pretty quickly, let me know if
> you want us to take that up.
> 

Yes. If it happens that US CERT also allocated one, this can be cleaned up before it goes public. But still don't have any anwer from them.  
Comment 16 Matthieu Herrb 2008-01-09 13:53:42 UTC
(In reply to comment #13)
> We'd really prefer to do them all at once.  And given that the patch in comment
> #9 looks like a unified patch for _all_ the outstanding issues, and that you
> seem to have attributed it to Alan, I suspect at least one other vendor wants
> them all done at once too.

No, I goofed and sent the whole diff (including the iDefense problems) I have in my tree. The patch for this, prepared by Alan is only the dixfonts.c part...

Comment 17 Josh Bressers 2008-01-11 04:17:46 UTC
Matthieu,

Use CVE-2008-0006 for this flaw.

Mail CERT back, telling them this CVE id, and let them know what you plan to do.  If we should release this with the various other pending security flaws, tell them that unless they tell you no, you assume their silence is agreement.  There's no sense in holding up a release due to a negligent reporting organization.

It may make sense to push the embargo out a few days though to give others more time to test this fix.
Comment 18 Matthieu Herrb 2008-01-11 11:34:42 UTC
(In reply to comment #17)
> Matthieu,
> 
> Use CVE-2008-0006 for this flaw.
> 
> Mail CERT back, telling them this CVE id, and let them know what you plan to
> do.  If we should release this with the various other pending security flaws,
> tell them that unless they tell you no, you assume their silence is agreement. 
> There's no sense in holding up a release due to a negligent reporting
> organization.
> 
> It may make sense to push the embargo out a few days though to give others more
> time to test this fix.
> 

I've sent email to CERT telling we're making the bug public on Thursday, unless they answer before tuesday.
Comment 19 Matthieu Herrb 2008-01-14 23:06:34 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > Matthieu,
> > 
> > Use CVE-2008-0006 for this flaw.
> > 
> > Mail CERT back, telling them this CVE id, and let them know what you plan to
> > do.  If we should release this with the various other pending security flaws,
> > tell them that unless they tell you no, you assume their silence is agreement. 
> > There's no sense in holding up a release due to a negligent reporting
> > organization.
> > 
> > It may make sense to push the embargo out a few days though to give others more
> > time to test this fix.
> > 
> 
> I've sent email to CERT telling we're making the bug public on Thursday, unless
> they answer before tuesday.
> 

Still no answer from CERT, so lets move forward. 
Comment 20 Matthieu Herrb 2008-01-17 08:33:54 UTC
Patch has been committed to xserver: 8e133d96740d010a4fd969a8188e6e71fb2cafe2 and libXfont: b76df66d2c507898472bba0f9986ef5700029a36. Ant this is public now. 
Comment 21 Kevin Day 2008-07-30 18:41:16 UTC
In regards to the libXfont part patch as applied above.

I noticed that pmfReadFont() has _almost_ identical code as the pcfReadFont(), except of course the "security fix" is not being applied there. (See line ~931 in the libXfont-1.3.3 source of src/bitmap/pcfread.c)

I don't know what pmf is and failed to find sufficient information to figure this out myself.

So my question is: Should pmfReadFont() also be patched in the same (or similar) way as pcfReadFont()?
Comment 22 Matthieu Herrb 2008-08-01 13:42:47 UTC
(In reply to comment #21)
> In regards to the libXfont part patch as applied above.
> 
> I noticed that pmfReadFont() has _almost_ identical code as the pcfReadFont(),
> except of course the "security fix" is not being applied there. (See line ~931
> in the libXfont-1.3.3 source of src/bitmap/pcfread.c)
> 
> I don't know what pmf is and failed to find sufficient information to figure
> this out myself.

It's the font format use by the Xprint server. So if vulnerable, the impact is lower. Xprint should not run privileged and afaik there's not way to make the regular X server use pmf fonts.
 
> So my question is: Should pmfReadFont() also be patched in the same (or
> similar) way as pcfReadFont()?
 
Probably, yes. I'll have a deeper look...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.