Top AppSec Job Interview Question 3

Опубликовано: 14 Октябрь 2024
на канале: Hamza Avvan (midnight)
129
14

AppSec interview questions
How to win job
Penetration testing job interview questions
AppSec job interview questions answer
top 50 cybersecurity interview questions and answers

Check out Interview Series Playlist:    • Interview Series  

Question: You find XSS in an application, however the customer informs you that users should be able to submit HTML code. What advice would you give them to remain secure?

Answer: One effective way to allow users to submit dynamic content without compromising security is by using a JSON-based approach.

Instead of exchanging raw HTML, which can be prone to XSS attacks, you can exchange a JSON document. This document would describe the structure and content of the desired HTML. For example, if you wish to render a link based on user input, instead of exchanging `<a href="some_url">blub</a>`, you could exchange the following JSON:

{
"element": {
"type": "a",
"attributes": {
"href": "some_url",
"link_text": "blub"
}
}
}

This method ensures that the dynamic content is separate from the structure. Since it's in JSON format, you can encode any dynamic parts without affecting the HTML rendering logic. Once you receive this JSON on the client side, you can use JavaScript to render the intended HTML elements.

By Tib3rius

#jobinterview #shorts