Which of the following is a method to improve the security of a website by preventing attacks like XSS? MCQ with Answer and Explanation

Which of the following is a method to improve the security of a website by preventing attacks like XSS?
A. Output encoding
B. Input validation
C. All of the above
D. Content Security Policy (CSP)
Answer: Option C
Solution (By JKSSB Mock Tests)
Output encoding, input validation, and CSP are all effective defenses against XSS attacks.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Internet and Web Technologies Questions

Question #1
What does the 'Secure' attribute flag do when appended to an HTTP cookie string specification?
A. It automatically formats the page text layout styles into complex encryption files.
B. It blocks automated search engine crawlers from reading the page structure.
C. It instructs the browser that the cookie should only be sent over encrypted HTTPS connections, protecting it from network interception.
D. It prevents the cookie from being deleted when the user closes the active window tab.

Correct Answer: Option C


Explanation:
The 'Secure' cookie attribute ensures that sensitive authentication cookies are never sent over unencrypted HTTP pathways, mitigating eavesdropping risks.

This question belongs to: Computer Internet and Web Technologies
Question #2
Which top-level domain designation (TLD) is reserved exclusively for official government entities and administrative bodies?
A. .net
B. .org
C. .com
D. .gov

Correct Answer: Option D


Explanation:
The '.gov' top-level domain is restricted solely to verified government agencies, institutional departments, and state-level operations.

This question belongs to: Computer Internet and Web Technologies
Question #3
Which specific protocol variant establishes a secure, encrypted file management channel over a standard Transport Layer Security (TLS) tunnel, separate from SSH-based options?
A. SMTP outbound pathways
B. Standard unencrypted FTP rules
C. Telnet console links
D. FTPS (File Transfer Protocol Secure)

Correct Answer: Option D


Explanation:
FTPS uses SSL/TLS encryption to protect file transfers, distinct from SFTP which relies on the SSH protocol layer for its security tunnels.

This question belongs to: Computer Internet and Web Technologies