A method for controlling opening of computer files by software applications on a user computer, the method comprising: detecting, by a hardware processor, a request from a software application to open a computer file on the user computer; determining, by the hardware processor, one or more parameters of the computer file; determining, by the hardware processor, a file access policy associated with the requested computer file based on the parameters of the computer file, wherein the file access policy specifies at least access rights of the software application to the resources of the user computer when working with the requested computer file; identifying, by the hardware processor, vulnerabilities of the software application; determining, by the hardware processor, an application launching policy for the software application based at least on the determined vulnerabilities, wherein the application launching policy specifies at least whether opening of the file is permitted or prohibited; the method being characterized by: determining, by the hardware processor, whether the software application is a source of untrusted files based on one or more of: searching in a database of known source applications of untrusted files, analysis of the behavior of the source application for loading of vulnerable modules or untrusted files; and analysis of metadata of the source application; and controlling, by the hardware processor, opening of the computer file on the user computer and accessing of the computer resources by the software application working with the opened file based at least on the determination whether the software application is the source of untrusted files, the file access policy and the application launching policy. detecting, by a hardware processor, a request from a software application to open a computer file on the user computer; determining, by the hardware processor, one or more parameters of the computer file; determining, by the hardware processor, a file access policy associated with the requested computer file based on the parameters of the computer file, wherein the file access policy specifies at least access rights of the software application to the resources of the user computer when working with the requested computer file; identifying, by the hardware processor, vulnerabilities of the software application; determining, by the hardware processor, an application launching policy for the software application based at least on the determined vulnerabilities, wherein the application launching policy specifies at least whether opening of the file is permitted or prohibited; determining, by the hardware processor, whether the software application is a source of untrusted files based on one or more of: searching in a database of known source applications of untrusted files, analysis of the behavior of the source application for loading of vulnerable modules or untrusted files; and analysis of metadata of the source application; and controlling, by the hardware processor, opening of the computer file on the user computer and accessing of the computer resources by the software application working with the opened file based at least on the determination whether the software application is the source of untrusted files, the file access policy and the application launching policy.