The file has no special protections associated with it.

ID

objectivec.storage.ios_file_perm

Severity

low

Resource

Storage

Language

Objective-C

Description

The file has no special protections associated with it.

Rationale

The file has no special protections associated with it.

The following code illustrates a vulnerable pattern detected by this rule:

void badFileProtectionNone() {
    NSString *filePath = @"/path/to/file";
    NSError *error = nil;
    // VULNERABLE: The file has no special protections associated with it.
    NSDictionary *attributes = @{NSFileProtectionKey: NSFileProtectionNone};
    [[NSFileManager defaultManager] setAttributes:attributes ofItemAtPath:filePath error:&error];
}

Remediation

Follow secure coding practices and review the references below for detailed remediation guidance.

Configuration

This detector does not need any configuration.