SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


PDF virus threat


PDF virus threat

Author
Message
NJDave
NJDave
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 598
Hello

An application that sits outside of our network will allow the user to store pdf files on the database.

The concern is that these pdf files could contain viruses.

The vendor says the file will be stored in a bitstream form so there should be no threat to the database.

The field type being used is varbinary(max).

I can't find info on what I can do - all my internet searches point to sql injection or remote code execution - nothing on viruses that could be stored in a pdf that would be stored as bitstream.

Any help is appreciated.

Thanls in advance
Dave
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28076 Visits: 39926
NJDave (7/1/2013)
Hello

An application that sits outside of our network will allow the user to store pdf files on the database.

The concern is that these pdf files could contain viruses.

The vendor says the file will be stored in a bitstream form so there should be no threat to the database.

The field type being used is varbinary(max).

I can't find info on what I can do - all my internet searches point to sql injection or remote code execution - nothing on viruses that could be stored in a pdf that would be stored as bitstream.

Any help is appreciated.

Thanls in advance
Dave



I had done a little bit of research when i read a similar thread;
I was surprised that pdf's support the embedding of pretty much any object, so anything embedded could potentially execute malicious code.
HOW it gets stored does not in any way prevent malicious code execution...whethere it's a file or filestream doesn't matter at all...it's the opening of the file that could potentially execute code.


I might consider adding a custom process...dump varbinary(max to disk, virus scan them, and delete or clean and put it back if it raises an alert.

another option might be to run the exisitng pdf into a CutePDF printer driver, which converts everything to presentable text/images , which MIGHT strip out other objects?
it's a tough

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (10K reputation)

Group: Moderators
Points: 10202 Visits: 1917
The concern is valid. It's a typical technique in spear phishing attacks.

By being stored, it won't affect SQL Server. SQL Server is not opening the document. I know that's not your primary concern, but I'm stating it explicitly for others who might be reading the thread.

There are a couple of ways to handle this:

1) Write the file to a file system where it's scanned before it gets put in SQL Server. Best, but requires retrofitting a solution, most likely.
2) Have a process that looks at files recently posted/updated, extracts them so they can get scanned. Non-intrusive, but allows the possibility that an infected file will be grabbed before it is scanned.

Do realize that AV is not the whole answer. Most of the intrusions we're seeing nowadays have files that successfully pass the AV scans. Therefore, updated and working AVs don't detect them and the computers are still infected. So make sure everything else is up to spec, too.

K. Brian Kelley
@‌kbriankelley
kevaburg
kevaburg
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1577 Visits: 988
My solution would be to store the PDFs outside of the database in the file system where it can be continually access scanned. This has the benefit of helping to prevent any embedded viruses from activating and the pleasant side-effect of keeping the size of the database down.
aframiller326
aframiller326
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 31
kevaburg (7/5/2013)
My solution would be to store the PDFs outside of the database in the file system where it can be continually access scanned. This has the benefit of helping to prevent any embedded viruses from activating and the pleasant side-effect of keeping the size of the database down.


Prefer your idea cuz it seems much easier. Share a blog with you guys and hope we can find a more efficient way for this PDF reading issue.

http://blog.spiderlabs.com/2010/10/preventing-malicious-pdf-file-uploads-pdf-reading
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search