Unit 1
Unit 1
o No user state — every request was treated as isolated and unrelated to previous
ones.
o Scripts (Perl, Shell, etc.) were executed on the server to return custom responses.
o User interaction was still limited, but more logic and personalization became
possible.
HTTP is stateless by design, but applications needed to maintain state (e.g., login
sessions).
Cookies, hidden form fields, and URL parameters were introduced to manage state
between requests.
This introduced new attack surfaces (e.g., session hijacking, parameter tampering).
AJAX (Asynchronous JavaScript and XML) allowed partial page updates and
smoother user experiences.
Web apps started behaving like desktop apps, e.g., Gmail, Google Maps.
Introduced complex client-server interactions, making apps harder to secure.
Use of frameworks (React, Angular, Vue), APIs (REST, GraphQL), and Single Page
Applications (SPAs).
Security shifted to both client and server side.
Attack surface now includes Web APIs, mobile clients, JavaScript-heavy logic, etc.
Summary Table:
Behavior:
Pages were static — content didn’t change unless the HTML file on the server was
modified.
No real interaction or logic; users could only request and view content.
No user state — every request was treated as isolated and unrelated to previous ones.
📌 Example:
A basic personal homepage hosted on GeoCities:
http://www.geocities.com/user123/home.html
This page simply displayed hard-coded text and images using plain HTML.
Behavior:
📌 Example:
A CGI guestbook using Perl:
http://example.com/cgi-bin/guestbook.pl?name=Alice
The server runs a Perl script that appends “Alice” to a guestbook file and displays it.
Behavior:
Pages could interact with databases (e.g., via SQL queries) to fetch or modify data.
Web applications started resembling traditional desktop applications in terms of
functionality.
📌 Example:
A PHP-based login form:
http://example.com/login.php
User submits credentials, which are validated via a SQL query:
php
CopyEdit
SELECT * FROM users WHERE username='$user' AND password='$pass';
HTTP is stateless by design, but applications needed to maintain state (e.g., login sessions).
Cookies, hidden form fields, and URL parameters were introduced to manage state
between requests.
This introduced new attack surfaces (e.g., session hijacking, parameter tampering).
📌 Example:
An e-commerce site that uses a session cookie to track the user's cart:
http
CopyEdit
GET /cart.php
Cookie: session_id=xyz789
The session_id keeps the cart contents persistent between visits.
Dynamic Document Object Model (DOM) manipulation allowed pages to update content
without reloading.
Opened the door to cross-site scripting (XSS) and other browser-based attacks.
📌 Example:
A form that uses JavaScript to validate user input before submission:
html
CopyEdit
<script>
if (!email.includes("@")) alert("Invalid email address");
</script>
Sites that reflect user input directly without sanitization become XSS targets:
php-template
CopyEdit
http://example.com/search?q=<script>alert('XSS')</script>
AJAX (Asynchronous JavaScript and XML) allowed partial page updates and smoother
user experiences.
Web apps started behaving like desktop apps, e.g., Gmail, Google Maps.
Introduced complex client-server interactions, making apps harder to secure.
📌 Example:
Gmail dynamically loads new messages with AJAX:
http
CopyEdit
GET /mail/inbox?last_id=345
Accept: application/json
The page updates new messages without refreshing, using JavaScript to inject the content.
🔐 7. Modern Web Applications
Use of frameworks (React, Angular, Vue), APIs (REST, GraphQL), and Single Page
Applications (SPAs).
📌 Example:
A React app that loads user data from a REST API:
js
CopyEdit
fetch("https://api.example.com/user", {
headers: { "Authorization": "Bearer jwt.token.here" }
});
Data is rendered on the fly using React components; user state is often stored in localStorage.
📊 Summary Table:
Risks
Era Interface Type Key Tech Example
Introduced
Early Web Static HTML HTML, HTTP Info disclosure Geocities homepage
CGI Era Dynamic pages CGI scripts Injection flaws Guestbook with query param in URL
Auth flaws,
Server-Side Logic Interactive apps PHP, ASP Login form using direct SQL queries
SQLi
Cookies, Session
Stateful Web Sessions Shopping cart via session_id cookie
tokens hijacking
🔹 Web Application
A web application is a software application that runs on a web server and is accessed through a
web browser over the internet or an intranet.
✅ Key Features:
📌 Technologies Used:
🔹 Cloud Application
A cloud application is a type of web application that leverages cloud computing—it uses cloud
infrastructure and services for storage, processing, scaling, and deployment.
✅ Key Features:
Built to take advantage of cloud platforms like AWS, Azure, or Google Cloud.
Highly scalable and resilient.
Often supports distributed architectures (e.g., microservices, containers).
Can have offline functionality (e.g., via local caching or service workers).
📌 Technologies Used:
Uses cloud-native tools: Kubernetes, Docker, serverless functions, cloud databases (e.g.,
DynamoDB, BigQuery).
🔄 Comparison Table
Offline Access Usually requires internet May support offline via cloud sync
🟢 In Summary:
All cloud apps are web apps, but not all web apps are cloud apps.
Cloud applications are more modern, scalable, and integrated with cloud services, while
traditional web apps are simpler and hosted on standard web servers.
Security fundamentals