static int open_flags_to_access_mode(int open_flags) {
 if ((open_flags & O_ACCMODE) == O_RDONLY) {
 return R_OK;
 } else if ((open_flags & O_ACCMODE) == O_WRONLY) {
 return W_OK;
 } else {
 /* Probably O_RDRW, but treat as default to be safe */
 return R_OK | W_OK;
 }
}

This category addresses vulnerabilities caused by flawed access control mechanisms, where incorrect permission settings allow unauthorized users to access restricted resources.