Opened 2 years ago
Closed 2 years ago
#8766 closed task (fixed)
moment.js is outdated and has CVEs
Reported by: | thomaslhotta | Owned by: | imath |
---|---|---|---|
Milestone: | 11.0.0 | Priority: | high |
Severity: | normal | Version: | 10.6.0 |
Component: | Core | Keywords: | has-patch 2nd-opinion |
Cc: |
Description
Hi
BuddyPress uses moment.js 2.15.1, which is quite a few years old (2016) and has two CSVs (CVE-2017-18214, CVE-2022-24785). Both are node.js related, so I do not think this is a security issue. But it might be good to upgrade to at least 2.29.2 anyway, just to be safe.
Change History (8)
#1
@
2 years ago
- Milestone changed from Awaiting Review to 11.0.0
- Owner set to imath
- Status changed from new to assigned
- Type changed from enhancement to task
#3
@
2 years ago
It's the case, see: https://github.com/WordPress/WordPress/commits/5.4-branch/wp-includes/js/dist/vendor/moment.js. Version used was v2.22.2
This ticket was mentioned in PR #39 on buddypress/buddypress by @imath.
2 years ago
#4
- Keywords has-patch added
This PR simply & softly deprecates bp-moment
JS dependency. That being said, as bp-moment
is only used by bp-livestamp
to live update human dates/time diff on the website, we could simply remove this dependency and save ~ 740 KB (see https://github.com/buddypress/buddypress/tree/master/src/bp-core/js/vendor/moment-js). Consequence would be the people using a WordPress version < 5.0 (a very limited population, see https://wordpress.org/about/stats/) would not enjoy this live updating feature anymore..
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8766
#5
@
2 years ago
- Keywords 2nd-opinion added
@dcavins what's your opinion about this ^^
. Should we simply deprecate and remove in 12.0.0, or can we completely remove this dependency right away ?
#6
@
2 years ago
Let's deprecate and remove in 12, as we normally would. The issues with the old moment.js don't seem worthy of creating an emergency. :)
I'm 100% in favor of letting WP provide the moment library though, as it, like at.js
, is no longer actively maintained and will require manual care.
Thanks for the good-looking patch! I'll try it today.
I agree, thanks a lot for your ticket. I even think WordPress is now including moment.js we might be able to completely remove it! I look at it asap.