Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CVE-2023-28120] Possible XSS Security Vulnerability in SafeBuffer#bytesplice (ActiveSupport) #6850

Closed
yeikel opened this issue Mar 16, 2023 · 3 comments

Comments

@yeikel
Copy link
Contributor

yeikel commented Mar 16, 2023

Solution : Upgrade ActiveSupport to Fixed Versions: 7.0.4.3, 6.1.7.3

Source : https://discuss.rubyonrails.org/t/cve-2023-28120-possible-xss-security-vulnerability-in-safebuffer-bytesplice/82469

There is a vulnerability in ActiveSupport if the new bytesplice method is called on a SafeBuffer with untrusted user input. This vulnerability has been assigned the CVE identifier CVE-2023-28120.

Versions Affected: All. Not affected: None Fixed Versions: 7.0.4.3, 6.1.7.3

Impact
ActiveSupport uses the SafeBuffer string subclass to tag strings as html_safe after they have been sanitized. When these strings are mutated, the tag is should be removed to mark them as no longer being html_safe.

Ruby 3.2 introduced a new bytesplice method which ActiveSupport did not yet understand to be a mutation. Users on older versions of Ruby are likely unaffected.

All users running an affected release and using bytesplice should either upgrade or use one of the workarounds immediately.

Releases
The FIXED releases are available at the normal locations.

Workarounds
Avoid calling bytesplice on a SafeBuffer (html_safe) string with untrusted user input.

Patches
To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.

6-1-7-bytesplice.patch - Patch for 6.1 series
7-0-4-bytesplice.patch - Patch for 7.0 series
Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits
Thanks to Akira Matsuda for reporting this vulnerability and for the patch.

@yeikel yeikel changed the title [CVE-2023-28120] Possible XSS Security Vulnerability in SafeBuffer#bytesplice [CVE-2023-28120] Possible XSS Security Vulnerability in SafeBuffer#bytesplice (ActiveSupport) Mar 16, 2023
@jeffwidman
Copy link
Member

Thanks for the heads up!

We dropped our dependency on ActiveSupport here:

So I don't think this will affect us?

@jeffwidman jeffwidman closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@jeffwidman
Copy link
Member

Also FYI for security issues, in general the best way to report to any repo maintainer (not just dependabot) is go to the security tab, and click Report a vulnerability... that allows you to report something privately w/o everyone else seeing it until/unless the maintainers are ready to make it public.

@yeikel
Copy link
Contributor Author

yeikel commented Mar 16, 2023

Also FYI for security issues, in general the best way to report to any repo maintainer (not just dependabot) is go to the security tab, and click Report a vulnerability... that allows you to report something privately w/o everyone else seeing it until/unless the maintainers are ready to make it public.

Thanks for the explanation. Given that this is a public vulnerability I did not think this was necessary but I understand why it is more appropriate to go that route

Thanks for the heads up!

We dropped our dependency on ActiveSupport here:

So I don't think this will affect us?

I was not aware of this change. From a quick search it seems that this is only used in tests so it should be fine

https://github.com/search?q=repo%3Adependabot%2Fdependabot-core+ActiveSupport&type=code&p=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants