Page MenuHomeFreeBSD

comsat: Don't read arbitrary files
ClosedPublic

Authored by des on Sun, Jul 27, 7:48 PM.
Tags
None
Referenced Files
F126321133: D51580.diff
Sun, Aug 17, 9:59 PM
Unknown Object (File)
Sat, Aug 2, 12:21 AM
Unknown Object (File)
Fri, Aug 1, 4:49 AM
Unknown Object (File)
Thu, Jul 31, 10:30 PM
Unknown Object (File)
Thu, Jul 31, 8:58 PM
Unknown Object (File)
Tue, Jul 29, 9:00 AM
Unknown Object (File)
Tue, Jul 29, 7:46 AM
Unknown Object (File)
Tue, Jul 29, 5:55 AM
Subscribers

Details

Summary

When processing a notification, instead of accepting any file name
that doesn't begin with a slash, accept only file names that don't
contain any slashes at all. This makes it possible to notify a
user about a mailbox that doesn't bear their name, as long as they
are permitted to read it, but prevents comsat from reading files
outside the mail spool.

PR: 270404
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Sun, Jul 27, 7:48 PM

Sorry, just realized this is incomplete. Will update in a bit.

Maybe we want to just discard a notification with a / in it rather than falling back to name (but I'm fine either way)

libexec/comsat/comsat.c
186

Probably worth calling out this cleanup specifically in the commit message

This revision is now accepted and ready to land.Mon, Jul 28, 2:58 PM
This revision was automatically updated to reflect the committed changes.