Skip to main content

Security

TypeDefinitionImpactPrevention
ClickjackingManipulating a website user's interaction by hiding clickable elements behind opaque layersTrick users into performing undesired actions, potentially leading to sensitive data exposureImplement X-Frame-Options HTTP response header. Use framebusting scripts

Password Storage​

VisualizationSpecs
Store Password
  • Avoid storing passwords in plain text to prevent unauthorized access
  • Storing password hashes alone is vulnerable to precomputation attacks like rainbow tables
  • Use salt to counter precomputation attacks by adding a unique, randomly generated string to each password before hashing
  • A salt, as per OWASP, is a unique, randomly generated string added to each password during hashing
  • Store passwords with their salt in the database by hashing the password combined with the salt
Validate Password
  • Validate passwords by fetching the corresponding salt from DB, appending it to the entered password, and comparing the resulting hash with the stored hash

Uniform Resources​

TypeDefinitionIdentity ResourcesExample
URI: Uniform Resource Identifier
  • Identifies a logical or physical resource on the web
  • scheme://path
  • scheme://authority/path?query string
URL: Uniform Resource Locator
  • URL is subtype of URI
  • Key concept of HTTP
  • Locates a resource
  • Address of a unique resource on the web
  • Can be used with other protocols

scheme://(domain name:port)authority/path to file?query string#anchor

  • scheme: http, https, ftp, sftp, file, mailto, tel, sms, urn, data, blob, ws, wss
  • domain name: google.com, amazon.com, apple.com, microsoft.com, usa.gov
  • port: 80, 443, 8080
  • path to file: assets/image.png
  • query string: order=asc&limit=10
  • anchor: initial_setup, overview, conclusion
http://(mysite.com:80)authority/path/to/file.html?product=book#docAnchor
URN: Uniform Resource Name
  • URN is subtype of URI
  • Locates names and resources
  • Uses the URN scheme
  • Cannot be used to locate a resource
scheme://namespace/namespace specific stringurn://isbn/888

Inner Workflow​

VisualizationStepsSpecs
  • Client and server establish a TCP connection
  • Client sends a "client hello" with encryption preferences and server responds with a "server hello" and SSL certificate
  • Client generates a session key, encrypts it with the server's public key, and sends it. Server decrypts it with its private key
  • Both parties use the shared session key for symmetric encryption, ensuring secure data transmission
  • Reasons for switching to symmetric encryption

    • Security: Asymmetric encryption only works one way, risking decryption if data is sent back to the client
    • Efficiency: Asymmetric encryption is resource-intensive, impractical for long sessions

Authentication Mechanisms​