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


Chapter 7  ■ Attacking Session Management



Download 5,76 Mb.
Pdf ko'rish
bet377/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   373   374   375   376   377   378   379   380   ...   875
Bog'liq
3794 1008 4334

Chapter 7 



Attacking Session Management



209

70779c07.qxd:WileyRed  9/14/07  3:13 PM  Page 209




existing subdomains to the domain name that is used to access the

application. In some cases, to ensure that this vulnerability does not

arise, it may be necessary to modify the domain- and path-naming

scheme employed by the various applications in use within the 

organization.

Specific measures should be taken to defend the session management mech-

anism against the variety of attacks with which the application’s users may

find themselves targeted:

■■

The application’s codebase should be rigorously audited to identify and



remove any cross-site scripting vulnerabilities (see Chapter 12). Most

such vulnerabilities can be exploited to attack session management

mechanisms. In particular, stored (or second-order) XSS attacks can usu-

ally be exploited to defeat every conceivable defense against session

misuse and hijacking. 

■■

Arbitrary tokens submitted by users that the server does not recognize



should not be accepted. The token should be immediately canceled

within the browser, and the user should be returned to the application’s

start page.

■■

Cross-site request forgery and other session attacks can be made more



difficult by requiring two-step confirmation and/or reauthentication

before critical actions such as funds transfers are carried out.

■■

Cross-site request forgery attacks can be defended against by not rely-



ing solely upon HTTP cookies for transmitting session tokens. Using

the cookie mechanism introduces the vulnerability because cookies are

automatically submitted by the browser regardless of what caused the

request to take place. If tokens are always transmitted in a hidden field

of an HTML form, then an attacker cannot create a form whose submis-

sion will cause an unauthorized action unless he already knows the

value of the token, in which case he can simply perform a trivial hijack-

ing attack. Per-page tokens can also help prevent these attacks (see the

following section).

■■

A fresh session should always be created after successful authentica-



tion, to mitigate the effects of session fixation attacks. Where an applica-

tion does not use authentication but does allow sensitive data to be

submitted, the threat posed by fixation attacks is harder to address. 

One possible approach is to keep the sequence of pages where sensitive

data is submitted as short as possible, and either (a) create a new ses-

sion at the first page of this sequence (where necessary, copying from

the existing session any required data, such as the contents of a shop-

ping cart), or (b) use per-page tokens (described in the following sec-

tion) to prevent an attacker who knows the token used in the first page


Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   373   374   375   376   377   378   379   380   ...   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