Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
HANDLE CreateFile(
  LPCTSTR lpFileName,
  DWORD dwDesiredAccess,
  DWORD dwShareMode,
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  DWORD dwCreationDisposition,
  DWORD dwFlagsAndAttributes,
  HANDLE hTemplateFile
);

Access permissions for new created files are influenced by the dwShareMode and lpSecurityAttributes parameters.

The dwSharedMode parameter is known as the sharing mode of a file. According to Microsoft, "An open file that is not shared cannot be opened again, either by the application that opened it or by another application, until its handle has been closed."

The lpSecurityAttributes parameter is used to specify access rights for the newly created file.

Risk Assessment

Creating files without appropriate access permissions may allow unintended access to those files.

...