Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

PDF virus threat Expand / Collapse
Author
Message
Posted Monday, July 1, 2013 7:08 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 9:54 AM
Points: 82, Visits: 498
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

Post #1469040
Posted Monday, July 1, 2013 7:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 2:08 PM
Points: 12,903, Visits: 31,972
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1469047
Posted Monday, July 1, 2013 7:25 AM


Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Monday, August 18, 2014 8:24 AM
Points: 6,634, Visits: 1,871
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, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security), SQLServerCentral.com
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #1469054
Posted Friday, July 5, 2013 2:57 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 3:16 AM
Points: 311, Visits: 485
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.
Post #1470629
Posted Thursday, December 5, 2013 1:36 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, May 21, 2014 3:51 AM
Points: 10, 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
Post #1519902
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse