File verification
File verification ensures that files go where they should go - stop directory traversal attacks early with default deny, and explicit allow on every file
Verify files​
Imagine you have written code that looks like this:
Your application in this case might be at risk of an attack that looks like this:
In this example, we might allow an attacker to send sensitive keys, databases (etc).
Allow no private apps​
To prevent this type of attack, we can use the verify command in order to check a file (or a URI) before opening it.
By default, no files from your private directory is allowed - which is what you want in most cases.
Allow specific private file​
We can allow a specific file
Allow all files in a directory​
Instead of this, we can add a directory and allow all files in that directory
Allow all files and subdirectories​
At the moment /data/data/com.safe.to.run/files/abc.txt
would be allowed, but /data/data/com.safe.to.run/files/subdir/abc.txt
would not. To allow subdirectories:
Allow any file​
We would not recommend doing this â›”:
Last updated