# CORS (Cross-Origin Resource Sharing)

> What is CORS, why does the browser enforce it, and how does a preflight request work?

Canonical: https://www.internhack.in/learn/interview/web-security/security-cors-fundamentals
Last updated: 2026-11-28

Difficulty: Beginner

## Question

What is CORS, why does the browser enforce it, and how does a preflight request work?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Same-Origin Policy, CORS, Preflight Request, Access-Control-Allow-Origin, Credentials

Previous: [CSRF: Cross-Site Request Forgery](https://www.internhack.in/learn/interview/web-security/security-csrf-explanation) · Next: [SQL Injection (SQLi)](https://www.internhack.in/learn/interview/web-security/security-sql-injection-prevention) · [All of Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)

## More Web Security (OWASP, JWT, XSS, CSRF) questions

- [Hashing vs. Encryption](https://www.internhack.in/learn/interview/web-security/security-hashing-vs-encryption)
- [HTTPS & TLS](https://www.internhack.in/learn/interview/web-security/security-https-tls-handshake)
- [Rate Limiting & Brute Force](https://www.internhack.in/learn/interview/web-security/security-brute-force-rate-limiting)
- [Security Headers (Helmet)](https://www.internhack.in/learn/interview/web-security/security-secure-headers)
- [Bcrypt: Salt & Cost](https://www.internhack.in/learn/interview/web-security/security-bcrypt-salting-work-factor)
- [OAuth 2.0 & OpenID Connect](https://www.internhack.in/learn/interview/web-security/security-oauth2-flows)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Web Security (OWASP, JWT, XSS, CSRF)](https://www.internhack.in/learn/interview/web-security)
