Review permission exports
Find world-writable entries in a supplied Unix mode export without changing permissions.
Review a snapshot, not the host
Unix mode bits express permissions for owner, group and others. In each octal digit, read is 4, write is 2 and execute is 1. The final digit therefore includes write for values 2, 3, 6 or 7. A group-writable file is not automatically world-writable.
This exercise consumes an inventory export with four-character modes from 0000 through 0777. It avoids portability differences between GNU and macOS stat, and it does not pretend the browser guest is your actual endpoint. Special mode bits, ACLs, mount options and directory traversal context are outside this narrow rule.
Report the observation accurately
A world-writable path deserves review, but its importance depends on what the file is and how it is used. Keep the owner and exact mode in the finding. Use the reason world_writable rather than guessing an exploit or changing permissions automatically.
Treat the mode as text when selecting its final digit. Bash arithmetic has octal conventions and can surprise you with leading zeros; no arithmetic is necessary for this rule. Paths containing spaces should stay in one TSV field. The task intentionally separates a safe review workflow from operational remediation, which would require an authorised machine and a tested change plan.
printf 'Mode 0664 gives others write: no\nMode 0666 gives others write: yes\n'
Put it into practice.
permissions.tsv has validated path<TAB>owner<TAB>mode records; mode is four digits from 0000 to 0777. Print path<TAB>owner<TAB>mode<TAB>reason for modes whose final digit is 2, 3, 6 or 7, with reason world_writable. Sort by path under LC_ALL=C. Keep the original mode string, and do not change files or permissions.
See an explained solution
export LC_ALL=C
printf 'path\towner\tmode\treason\n'
awk -F '\t' 'NR>1 && substr($3,4,1)~/^[2367]$/ {printf "%s\t%s\t%s\tworld_writable\n",$1,$2,$3}' permissions.tsv | sort
The rule examines exactly the others permission digit, so group write alone cannot trigger a finding. It preserves the owner, path and complete mode as evidence without making any change to the system.