جواب «Name the Risk» چالش 1 از جلسهی 58
سؤال
برنامه یک جملهی کوتاه میگیرد که یک اشتباه را توصیف میکند و باید نام خطر OWASP آن را چاپ کند. فقط این پنج تا: sees another user's order → broken access control، password stored in plain text → cryptographic failures، input becomes a command → injection، default admin password → security misconfiguration، library from 2019 → vulnerable components. هر چیز دیگر → other.
راهنما
یک دیکشنری از جمله به نام خطر و .get(sentence, "other").
یک جواب درست
risks = {
"sees another user's order": "broken access control",
"password stored in plain text": "cryptographic failures",
"input becomes a command": "injection",
"default admin password": "security misconfiguration",
"library from 2019": "vulnerable components",
}
sentence = input()
print(risks.get(sentence, "other"))
اول خودت امتحان کن؛ جوابهای دیگر هم قبول است. برگرد و خودت حلش کن