GitHub Advisoryadvisory · RubyGems
GHSA-5cr9-5jx3-2g39 avo vulnerable to Stored XSS (Cross Site Scripting) in html content based fields
HIGH
Official page ↗
- Aliases
- CVE-2023-34103
- Ecosystem
- RubyGems
- Packages
- avo
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2023-06-06
Affected packages
• RubyGems avo: < 2.33.3 → fixed in 2.33.3
• RubyGems avo: >= 3.0.0.pre1, <= 3.0.0.pre12 (no fix yet)
Description
Summary
Some avo fields are vulnerable to XSS when rendering html based content.
Details
During the analysis of the web application, a rendered field was discovered that did not filter JS / HTML tags in a safe way and can be abused to execute js code on a client side. The trix field uses the trix editor in the backend to edit rich text data which basically operates with html tags. To display the stored data in a rendered view, the HasHTMLAttributes concern is used. This can be exploited by an attacker to store javascript code in any trix field by intercepting the request and modifying the post data, as the trix editor does not allow adding custom html or js tags on the frontend.
PoC
_Adding javascript in the post request which is used when editing a "post" resource (body is declared as a trix field)_
_Successful execution of JS code on live demo environment_
Impact
Unlike non-persistent XSS, persistent XSS does not require a social engineering phase. Victims of this attack do not need to be tricked into clicking a link or something like that. However, by exploiting such a vulnerability on this particular target, attackers may be able to gain access to accounts that require special protection, such as administrators of the web service, which is what Avo is primarily intended to be used for.
Recommendation
The content of a field that contains html code should be sanitized using the according rails helper which uses a whitelist of known-safe tags and attributes. Also this security consideration should be applied to the “as_html” attribute as well because it may contain user controlled input as well.
https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html
Related
Alias · CVE (1)
- CVE-2023-34103 Avo is an open source ruby on rails admin panel creation framework. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/avo-hq/avo/security/advisories/GHSA-5cr9-5jx3-2g39 web
- https://nvd.nist.gov/vuln/detail/CVE-2023-34103 advisory
- https://github.com/avo-hq/avo/commit/7891c01e1fba9ca5d7dbccc43d27f385e5d08563 web
- https://github.com/avo-hq/avo package
- https://github.com/avo-hq/avo/releases/tag/v2.33.3 web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/avo/CVE-2023-34103.yml web