PDF virus threat

  • 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

  • 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!

  • 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

  • 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.

  • kevaburg (7/5/2013)


    My solution would be to store the PDF[/url]s 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[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply