Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Security Flaw in User Addition Script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Security Flaw in User Addition Script
Authored by: thrig on Dec 19, '05 10:02:16AM
echo "${newuser}:********:${uid}:${pgid}::0:0:${comment}:${newhome}:${shell:-/bin/bash}" > ${tmpfile}

Contains a /tmp security flaw. Any user can create a symbolic link from /tmp/niuser-$(date +%s) to a critical file, and the next time the above code runs, the critical file will be clobbered. Instead, use the mktemp utility to create a temporary file, if needed.



[ Reply to This | # ]