🔍 CVE-2023-38487

6.5
CVSS Score
MEDIUM
2023-08-04
2026-06-17 06:10
✅ 완료

🇰🇷 한글 설명

HedgeDoc 1.9.9 미만 버전에서 freeURL 기능이 활성화된 경우, 기존 노트의 ID와 동일한 별칭(alias)을 가진 새 노트를 생성하여 기존 노트를 가릴 수 있는 취약점이 존재합니다. 공격자는 이를 통해 사용자가 원본 대신 조작된 노트를 보게 하거나 서비스 거부(DoS) 상태를 유발할 수 있습니다.

💡 쉬운 설명

기존에 있던 메모의 주소와 똑같은 주소를 가진 가짜 메모를 만들어, 원래 메모를 못 보게 숨겨버리는 문제입니다. 공격자가 가짜 메모에 나쁜 링크를 넣어 사용자를 속일 수도 있습니다.

🇺🇸 원문 (English)

HedgeDoc is software for creating real-time collaborative markdown notes. Prior to version 1.9.9, the API of HedgeDoc 1 can be used to create notes with an alias matching the ID of existing notes. The affected existing note can then not be accessed anymore and is effectively hidden by the new one. When the freeURL feature is enabled (by setting the `allowFreeURL` config option or the `CMD_ALLOW_FREEURL` environment variable to `true`), any user with the appropriate permissions can create a note by making a POST request to the `/new/<ALIAS>` API endpoint. The `<ALIAS>` parameter can be set to the ID of an existing note. HedgeDoc did not verify whether the provided `<ALIAS>` value corresponds to a valid ID of an existing note and always allowed creation of the new note. When a visitor tried to access the existing note, HedgeDoc will first search for a note with a matching alias before it searches using the ID, therefore only the new note can be accessed. Depending on the permission settings of the HedgeDoc instance, the issue can be exploited only by logged-in users or by all (including non-logged-in) users. The exploit requires knowledge of the ID of the target note. Attackers could use this issue to present a manipulated copy of the original note to the user, e.g. by replacing the links with malicious ones. Attackers can also use this issue to prevent access to the original note, causing a denial of service. No data is lost, as the original content of the affected notes is still present in the database. This issue was fixed in version 1.9.9. As a workaround, disabling freeURL mode prevents the exploitation of this issue. The impact can be limited by restricting freeURL note creation to trusted, logged-in users by enabling `requireFreeURLAuthentication`/`CMD_REQUIRE_FREEURL_AUTHENTICATION`.

📍 영향받는 시스템

HedgeDoc 1.9.9 미만 버전 (allowFreeURL 설정이 true인 경우)

⚔️ 공격 벡터

기존 노트 ID를 알아낸 후 /new/<ALIAS> API 엔드포인트로 POST 요청을 보내 동일한 별칭의 노트를 생성

🛡️ 대응 방법

HedgeDoc를 1.9.9 버전 이상으로 업데이트하거나, allowFreeURL 설정을 비활성화 또는 requireFreeURLAuthentication를 활성화합니다.

🔧 검증 코드

출력된 버전 정보가 1.9.9 미만인 경우 해당 취약점에 노출된 상태입니다.

Shell / Script
curl -s http://<HedgeDoc_IP>:<PORT>/api/version | grep -E '1\.[0-9]\.[0-9]' | grep -v '1\.9\.9'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:L

💻 영향받는 소프트웨어

IBM Security Verify Access