The Web Application Hacker’s Handbook Discovering and Exploiting Security Flaws



Download 5,76 Mb.
Pdf ko'rish
bet276/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   272   273   274   275   276   277   278   279   ...   875
Bog'liq
3794 1008 4334

Fail-Open Login Mechanisms

Fail-open logic is a species of logic flaw (described in detail in Chapter 11) and

one that has particularly serious consequences in the context of authentication

mechanisms.

The following is a fairly contrived example of a login mechanism that fails

open. If the call to 

db.getUser()

throws an exception for some reason (for

example, a null pointer exception arising because the user’s request did not

contain a username or password parameter), then the login will be successful.

Although the resulting session may not be bound to a particular user identity,

and so may not be fully functional, this may still enable an attacker to access

some sensitive data or functionality.

public Response checkLogin(Session session) {

try {

String uname = session.getParameter(“username”);



String passwd = session.getParameter(“password”);

User user = db.getUser(uname, passwd);

if (user == null) {

// invalid credentials

session.setMessage(“Login failed.”);

return doLogin(session);

}

}

catch (Exception e) {}



// valid user

session.setMessage(“Login successful.”);

return doMainMenu(session);

}


Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   272   273   274   275   276   277   278   279   ...   875




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish