OS X is built on UNIX and often touted as being more secure because of it. However, that doesn’t mean it doesn’t have its own security flaws. The UNIX “sudo” command is supposed to be available only to administrators and then only after you enter your password, as it’s a powerful administrative command that can allow changes to system files and bypassing of permissions. This flaw in OS X allows someone to use the sudo command and get root access without providing a password.
Read more here: