11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

334 Part III: Building Secure <strong>Web</strong> <strong>Application</strong>sUser Name <strong>and</strong> PasswordYou can send user names <strong>and</strong> password credentials in the SOAP header. However,because these are sent in plaintext, this approach should only be used in conjunctionwith SSL due to the network eavesdropping threat. The credentials are sent as part ofthe element, in the SOAP header as follows.BobYourStr0ngPassWordUser Name <strong>and</strong> Password DigestInstead of sending a plaintext password, you can send a password digest. The digestis a Base64-encoded SHA1 hash value of the UTF8-encoded password. However,unless this approach is used over a secure channel, the data can still be intercepted byattackers armed with network monitoring software <strong>and</strong> reused to gain authenticatedaccess to your <strong>Web</strong> service. To help address this replay attack threat, a nonce <strong>and</strong> acreation timestamp can be combined with the digest.User Name <strong>and</strong> Password Digest with Nonce <strong>and</strong> TimestampWith this approach the digest is a SHA1 hash of a nonce value, a creation timestamp,<strong>and</strong> the password as follows.digest = SHA1(nonce + creation timestamp + password)With this approach, the <strong>Web</strong> service must maintain a table of nonce values <strong>and</strong> rejectany message that contains a duplicate nonce value. While the approach helps protectthe password <strong>and</strong> offers a basis for preventing replay attacks, it suffers from clocksynchronization issues between the consumer <strong>and</strong> provider when calculating anexpiration time, <strong>and</strong> it does not prevent an attacker capturing a message, modifyingthe nonce value, <strong>and</strong> then replaying the message to the <strong>Web</strong> service. To address thisthreat, the message must be digitally signed. With the WSE, you can sign a messageusing a custom token or an X.509 certificate. This provides tamperproofing <strong>and</strong>authentication, based on a public, private key pair.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!