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


Chapter 12  ■ Attacking Other Users



Download 5,76 Mb.
Pdf ko'rish
bet728/875
Sana01.01.2022
Hajmi5,76 Mb.
#293004
1   ...   724   725   726   727   728   729   730   731   ...   875
Bog'liq
3794 1008 4334

Chapter 12 



Attacking Other Users



423

70779c12.qxd:WileyRed  9/14/07  3:14 PM  Page 423




Having identified all of the operations which are potentially at risk of XSS

and which need to be suitably defended, a threefold approach should be taken

to prevent any actual vulnerabilities arising. This approach comprises the fol-

lowing elements:

■■

Validate input.



■■

Validate output.

■■

Eliminate dangerous insertion points.



Validate Input

At the point where the application receives user-supplied data that may be

copied into one of its responses at any future point, the application should per-

form context-dependent validation of this data, in as strict a manner as possi-

ble. Potential features to validate include the following:

■■

That the data is not too long.



■■

That the data only contains a certain permitted set of characters.

■■

That the data matches a particular regular expression.



Different validation rules should be applied as restrictively as possible to

names, email addresses, account numbers, and so on, according to the type of

data that the application is expecting to receive in each field.

Validate Output

At the point where the application copies into its responses any item of data

that originated from some user or third party, this data should be HTML-

encoded to sanitize potentially malicious characters. HTML-encoding

involves replacing literal characters with their corresponding HTML entities.

This ensures that browsers will handle potentially malicious characters in a

safe way, treating them as part of the content of the HTML document and not

part of its structure. The HTML-encodings of the primary problematic charac-

ters are as follows:

“    "

‘    '

&    &



<    <

>    >

In addition to these common encodings, in fact any character can be HTML-

encoded using its numeric ASCII character code, as follows:

%    %

*    *




Download 5,76 Mb.

Do'stlaringiz bilan baham:
1   ...   724   725   726   727   728   729   730   731   ...   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