Arch Linux Security Advisory ASA-202105-9
=========================================

Severity: High
Date    : 2021-05-19
CVE-ID  : CVE-2021-29503
Package : hedgedoc
Type    : cross-site scripting
Remote  : Yes
Link    : https://security.archlinux.org/AVG-1946

Summary
=======

The package hedgedoc before version 1.8.2-1 is vulnerable to cross-site
scripting.

Resolution
==========

Upgrade to 1.8.2-1.

# pacman -Syu "hedgedoc>=1.8.2-1"

The problem has been fixed upstream in version 1.8.2.

Workaround
==========

In order to prevent unauthenticated attacks it can be useful to disable
guest edits until the next update. To do this, set the following to
configuration options:

{
    # other configs
    # …
     "allowAnonymous": false,
     "allowAnonymousEdits": false,

}

Or set the environment variables CMD_ALLOW_ANONYMOUS=false and
CMD_ALLOW_ANONYMOUS_EDITS=false.

Description
===========

HedgeDoc before version 1.8.2  is vulnerable to a cross-site scripting
(XSS) attack using the YAML-metadata of a note. An attacker with write
access to a note can embed HTML tags in the Open Graph metadata section
of the note, resulting in the frontend rendering the script tag as part
of the  section.

This vulnerability affects all installations. Unless your instance
prevents guests from editing notes, this vulnerability allows
unauthenticated attackers to inject JavaScript into notes that allow
guest edits. If your instance prevents guests from editing notes, this
vulnerability allows authenticated attackers to inject JavaScript into
any note pages they have write-access to.

Impact
======

A remote attacker with write access to a note can inject arbitrary
JavaScript code that is executed through cross-site scripting when the
note is viewed.

References
==========

https://github.com/hedgedoc/hedgedoc/security/advisories/GHSA-gjg7-4j2h-94fq
https://github.com/hedgedoc/hedgedoc/commit/4a0216096a6aa1ebba9d8b0ada067c73ffa1513f
https://security.archlinux.org/CVE-2021-29503