CWE-224: Obscured Security-relevant Information by Alternate Name
The product records security-relevant information according to an alternate name of the affected entity, instead of the canonical name.
Last updated
Overview
CWE-224 (Obscured Security-relevant Information by Alternate Name) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Common consequences
What can happen when CWE-224 is exploited.
Hide Activities, Gain Privileges or Assume Identity
Affects: Non-Repudiation, Access Control
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Code examples
MITRE examples of the weakness in code.
This code prints the contents of a file if a user has permission.
Vulnerable example
function readFile($filename){
$user = getCurrentUser();
$realFile = $filename;
//resolve file if its a symbolic link
if(is_link($filename)){
$realFile = readlink($filename);
}
if(fileowner($realFile) == $user){
echo file_get_contents($realFile);
return;
}
else{
echo 'Access denied';
writeLog($user . ' attempted to access the file '. $filename . ' on '. date('r'));
}
}