# Cross Site Scripting (XSS)

Tin tặc có thể chèn mã JavaScript vào các trang web có lỗi XSS.

Cross-site Scripting (XSS) là một cuộc tấn công tiêm mã phía máy khách. Kẻ tấn công nhằm mục đích thực thi các tệp lệnh độc hại trong trình duyệt web của nạn nhân bằng cách đưa mã độc vào trang web hoặc ứng dụng web hợp pháp.

Thường xảy ra khi có hộp tin nhắn văn bản trên trang web.

Like comments cho một blog.

<details>

<summary>Biện pháp giảm nhẹ</summary>

* Xác thực đầu vào
* Vệ sinh tất cả đầu vào (như xóa dấu ngoặc kép và ký tự đặc biệt)
* mã hóa dữ liệu on output

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://viettaliii.gitbook.io/home/soc-and-dfir/interview-questions/cross-site-scripting-xss.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
