Bird
0
0

In a connected EV system, the code below causes a security flaw:

medium📝 Analysis Q7 of 15
EV Technology - Connected Vehicle (V2X)
In a connected EV system, the code below causes a security flaw:
def authenticate(user_input):
    if user_input == "admin":
        return True
    else:
        return False

What is the main problem?
AHardcoded password allows easy unauthorized access
BFunction does not return any value
CIncorrect indentation causes syntax error
DMissing encryption for user input
Step-by-Step Solution
Solution:
  1. Step 1: Analyze authentication method

    The function checks if input equals a fixed string "admin".
  2. Step 2: Identify security risk

    Hardcoded passwords are insecure because attackers can guess them easily.
  3. Final Answer:

    Hardcoded password allows easy unauthorized access -> Option A
  4. Quick Check:

    Hardcoded passwords = Security risk [OK]
Quick Trick: Avoid hardcoded passwords; use secure methods [OK]
Common Mistakes:
  • Thinking missing encryption is the main flaw here
  • Ignoring the risk of fixed passwords

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More EV Technology Quizzes