> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/security/bwapp/html-injection-reflected_get.md).

# HTML Injection   Reflected\_GET

## Low

html 코드의 삽입 취약점이 있는 것을 알 수 있음

사용자의 입력을 저장하는 파라미터에 위약함을 알 수 있다.

## Medium

문자열로 처리된다.

## Check

### low\_level

### Medium

<: gt\
\>: lt

[아스크코드](https://www.ascii-code.com/)로 인코딩해 입력하면 될 것 같다. = [URL 인코딩](file:///2237607/security/DoubleEncoding.md)

<details>

<summary>인코딩 예시</summary>

```
<h1>hello</h1> = %3ch1%3ehello%3c%2fh1%3e
```

</details>

* html은 입력을 서버에 넘길때 아스키 코드로 인코딩해 전달
* 서버는 받은 입력을 디코딩
* 두 값의 비교는 인코딩 전 입력 값으로 비교하기 때문에 먼저 인코딩하여 전달할 경우 처리를 우회할 수 있게 된다.

### high

{% hint style="info" %}
html injection을 방어하는 가장 좋은 방법은 htmlspecialchars()를 사용하는 것
{% endhint %}

{% hint style="warning" %}
또는 입력하는 문자열의 길이를 제한하는 것 또한 좋은 방법이 될 것이다.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/security/bwapp/html-injection-reflected_get.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
