#61489 closed defect (bug) (worksforme)
6.1.7 and 6.2.6 Updates Cause Critical Error
Reported by: | mping001 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.1 |
Component: | Upgrade/Install | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Today we had around 20+ sites go down sporadically across multiple servers and hosting providers. All of the sites were on 6.1.7 or 6.2.6 and had the same errors:
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “_wp_footnotes_kses_init” not found or invalid function name in /wp-includes/class-wp-hook.php:308
After verifying checksums on core we found that the wp-includes/default-filters.php
file did not match and we had to re-download core on all the sites to get rid of the critical error. I imagine this will be happening for us most of the day. We checked server and security logs and didn’t find anything correlated to the issue and believe it may be something to do with the update methods. Not sure but some insight here would be helpful.
Attachments (3)
Change History (52)
#3
follow-up:
↓ 4
@
5 months ago
@mping001 Thank you for the ticket, are you able to let me know the following:
- Were the sites auto-updated or manually updated
- If manually updated, was this done by downloading the update from wordpress.org, via wp-cli or another method?
#4
in reply to:
↑ 3
@
5 months ago
Replying to peterwilsoncc:
@mping001 Thank you for the ticket, are you able to let me know the following:
- Were the sites auto-updated or manually updated
- If manually updated, was this done by downloading the update from wordpress.org, via wp-cli or another method?
It was automatically updated. We have minor updates enabled in the wp-config file. But when the sites went down with the critical errors we downloaded using: wp core update --force --version='6.1.7' or '6.2.6' then it did verify checksums and the fatal error was gone.
Edit because I failed to mention that the issue came back a few times for a couple of the sites even after updating via cli.
#5
@
5 months ago
Hi @mping001
The error stack trace indicates an issue with the CleanTalk plugin for WordPress. Specifically, it is caused by a function _wp_footnotes_kses_init that is either missing or incorrectly named. This function is being called via call_user_func_array in the class-wp-hook.php file, which handles WordPress hooks and actions.
Could you please try to deactivate plugins or check for the updates.
#6
@
5 months ago
Same here. After auto-update 9 of 12 sites are offline. Needed to upload the version before data. Time for me to disable Auto Update Function for Security Updates to.
Version: 6.5.5 and 6.4.5 and 6.2.5
#7
@
5 months ago
@narenin I first thought that as well. We updated cleantalk, and we looked into the _wp_footnotes_init error and it appears that should only be used by core wordpress. We verified checksums on the current update and they did not match after the automatic update and the default-filters.php file failed the checksum which we believe was the source of the issue. Upon re-downloading the update file using wp-cli the site is functioning normally.
#8
@
5 months ago
Same here with 1 site that automatically upgrade to v6.2.6.
We needed to update this site to 6.5.5 to get rid of the error.
#9
follow-ups:
↓ 10
↓ 12
@
5 months ago
@thismatters @sberney Were each of you seeing the same errors regarding _wp_footnotes_kses_init
?
#10
in reply to:
↑ 9
@
5 months ago
Replying to peterwilsoncc:
@thismatters @sberney Were each of you seeing the same errors regarding
_wp_footnotes_kses_init
?
Yes !
#11
@
5 months ago
didn`t had a look there - sorry. But rollback to the older WP Version solves this issue. (Uploading wp-include and wp-admin folders).
#12
in reply to:
↑ 9
@
5 months ago
Replying to peterwilsoncc:
@thismatters @sberney Were each of you seeing the same errors regarding
_wp_footnotes_kses_init
?
We have a site that has just been updated from version 6.2.5 to 6.2.6 (while our staging environment remains at 6.2.5 and is functioning normally), and we are also seeing this error with the same function _wp_footnotes_kses_init. Several plugins are affected by this missing function, such as GiveWP.
Edit : Rollback production to version 6.2.5 fixed it.
#13
follow-up:
↓ 20
@
5 months ago
First off, a reminder that only the most recent in the 6.5 series is safe to use and actively maintained. While security patches are backported as a courtesy, you are strongly encouraged to only use the actively maintained version.
I've checked the following zips so far:
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-0.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-1.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-2.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-3.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-4.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-5.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-no-content.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-new-bundled.zip
None of them contain a file with any reference to _wp_footnotes_kses_init
.
Does anyone have logs on their server to indicate which zip file they received that contains the invalid file?
I know that some hosts will proxy requests and supply their own zips, so if possible could you also reach out to your host if you are experiencing this and share this ticket and ask them if they have any additional information. I'm also reaching out to the meta team to ask them to check all of the files on the download server for any I may have missed so we can see if one of them has an incorrect file.
This ticket was mentioned in Slack in #meta by jorbin. View the logs.
5 months ago
This ticket was mentioned in Slack in #core-test by ankit-k-gupta. View the logs.
5 months ago
#17
follow-up:
↓ 18
@
5 months ago
I've just noticed that when commenting on lines 602-603 of the file "/wp-includes/default-filters.php" :
// Footnotes Block. //add_action( 'init', '_wp_footnotes_kses_init' ); //comment to get rid of error //add_action( 'set_current_user', '_wp_footnotes_kses_init' ); //comment to get rid of error
makes the error disappear
But I don't have any logs of the file that was downloaded during update.
Maybe it's related to the add_action/filter command that didn't load the file containing the "_wp_footnotes_kses_init" function before calling it here ?!
#18
in reply to:
↑ 17
@
5 months ago
Replying to sberney:
I've just noticed that when commenting on lines 602-603 of the file "/wp-includes/default-filters.php" :
// Footnotes Block. //add_action( 'init', '_wp_footnotes_kses_init' ); //comment to get rid of error //add_action( 'set_current_user', '_wp_footnotes_kses_init' ); //comment to get rid of errormakes the error disappear
But I don't have any logs of the file that was downloaded during update.
Maybe it's related to the add_action/filter command that didn't load the file containing the "_wp_footnotes_kses_init" function before calling it here ?!
Thanks @sberney this was it. I just downloaded the current 6.2.6 release zip and replaced default-filters.php in all my sites, now they're working fine.
#19
@
5 months ago
Looks like _wp_footnotes_kses_init
was introduced in WP 6.3.2, and is therefore not available in prior versions.
https://developer.wordpress.org/reference/functions/_wp_footnotes_kses_init/#changelog
#20
in reply to:
↑ 13
@
5 months ago
Replying to jorbin:
First off, a reminder that only the most recent in the 6.5 series is safe to use and actively maintained. While security patches are backported as a courtesy, you are strongly encouraged to only use the actively maintained version.
I've checked the following zips so far:
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-0.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-1.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-2.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-3.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-4.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-partial-5.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-no-content.zip
- https://downloads.wordpress.org/release/wordpress-6.2.6-new-bundled.zip
None of them contain a file with any reference to
_wp_footnotes_kses_init
.
Does anyone have logs on their server to indicate which zip file they received that contains the invalid file?
I know that some hosts will proxy requests and supply their own zips, so if possible could you also reach out to your host if you are experiencing this and share this ticket and ask them if they have any additional information. I'm also reaching out to the meta team to ask them to check all of the files on the download server for any I may have missed so we can see if one of them has an incorrect file.
I don't think the zips have an incorrect file. The automated update doesn't include the same default-filters.php file that is included when updating the files manually. The automatic update files do not pass checksum verification in wp-cli which means they have been altered or are not included in that release. When you manually download the files the proper file is included and the fatal errors go away.
#21
@
5 months ago
I share with you some hacks to get rid of this error.
First, is to touch WP core code, commenting some lines in /wp-includes/default-filters.php
(as mentionned before) or add a short code in wp-load.php
:
<?php // QUICKFIX https://core.trac.wordpress.org/ticket/61489 function _wp_footnotes_kses_init(){ return false; }
Theses changes will be overwritten by the next WP update.
Second, rollback to previous version if you have wp-cli.org tool installed in the local/remote terminal:
wp core update --version=6.2.5 --force
wp core update --version=6.1.6 --force
This ticket was mentioned in Slack in #core by tomsommer. View the logs.
5 months ago
This ticket was mentioned in Slack in #hosting by tomsommer. View the logs.
5 months ago
#24
follow-up:
↓ 27
@
5 months ago
The automated update doesn't include the same default-filters.php file that is included when updating the files manually
The automated updates use those zips which is why I'm investigating those.
Walking through the default-filters file from 6.3, 6.4. and 6.5, none of them have the Footnotes Block code on line 602 so I'm not sure where this file is coming from at all. Would someone be able to upload the file they are seeing on a broken site?
#25
@
5 months ago
Here's the file (dated on our server from 17.10.2023) : https://databird.ch/_dev/bug_wp/default-filters.zip
#26
@
5 months ago
Some debug information, as requested on Slack:
[example.com@server ~]$ fgrep -R '_wp_footnotes_kses_init' * public_html/wp-includes/default-filters.php:add_action( 'init', '_wp_footnotes_kses_init' ); public_html/wp-includes/default-filters.php:add_action( 'set_current_user', '_wp_footnotes_kses_init' ); ^C [example.com@server ~]$ cd public_html/ [example.com@server public_html]$ wp version PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_wp_footnotes_kses_init' not found or invalid function name in /var/www/example.com/public_html/wp-includes/class-wp-hook.php on line 307 Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_wp_footnotes_kses_init' not found or invalid function name in /var/www/example.com/public_html/wp-includes/class-wp-hook.php on line 307 Error: 'version' is not a registered wp command. See 'wp help' for available commands. [example.com@server public_html]$ wp core version 6.0.9 [example.com@server public_html]$ ls -l wp-includes/default-filters.php -rw-r--r-- 1 example.com example.com 31071 Apr 11 04:41 wp-includes/default-filters.php
#27
in reply to:
↑ 24
;
follow-up:
↓ 28
@
5 months ago
Replying to jorbin:
The automated update doesn't include the same default-filters.php file that is included when updating the files manually
The automated updates use those zips which is why I'm investigating those.
Walking through the default-filters file from 6.3, 6.4. and 6.5, none of them have the Footnotes Block code on line 602 so I'm not sure where this file is coming from at all. Would someone be able to upload the file they are seeing on a broken site?
Ah sorry. We just had it happen to a site with 6.0.9 and it didn't take the site down but put the error on the homepage for some reason.
I uploaded the bad file here: https://core.trac.wordpress.org/attachment/ticket/61489/default-filters-error.php
and good file here: https://core.trac.wordpress.org/attachment/ticket/61489/default-filters-good.php
If I get another 6.1.7 or 6.2.6 I will add as well.
#28
in reply to:
↑ 27
@
5 months ago
Replying to mping001:
Replying to jorbin:
The automated update doesn't include the same default-filters.php file that is included when updating the files manually
The automated updates use those zips which is why I'm investigating those.
Walking through the default-filters file from 6.3, 6.4. and 6.5, none of them have the Footnotes Block code on line 602 so I'm not sure where this file is coming from at all. Would someone be able to upload the file they are seeing on a broken site?
Ah sorry. We just had it happen to a site with 6.0.9 and it didn't take the site down but put the error on the homepage for some reason.
I uploaded the bad file here: https://core.trac.wordpress.org/attachment/ticket/61489/default-filters-error.php
and good file here: https://core.trac.wordpress.org/attachment/ticket/61489/default-filters-good.php
If I get another 6.1.7 or 6.2.6 I will add as well.
We have vulnerability patching detection that is triggering on the default-filters.php with the following details:
Name:
XSS vulnerability in the footnotes block
Description:
The footnotes block is not adequately protected against an XSS attack.
This was not detected prior to the updates and we have patching disabled. We keep having the issue come back on sites that we previously fixed and have no idea why the file is being reverted. Nothing in the logs points to anything replacing the file.
This ticket was mentioned in Slack in #core by dd32. View the logs.
5 months ago
#30
@
5 months ago
@mping001 @tomsommer @sberney @thismatters Could one of you provide the URL of an affected site? If you don't wish to share it on a public ticket, feel free to reach out to me via DM in wordpress.slack.com
#31
follow-up:
↓ 32
@
5 months ago
Just to confirm, are the sites running with major-version auto-updates disabled?
ie. What do you see on wp-admin/update-core.php
?
This site is automatically kept up to date with maintenance and security releases of WordPress only.
Enable automatic updates for all new versions of WordPress.
or
This site is automatically kept up to date with each new version of WordPress.
Switch to automatic updates for maintenance and security releases only.
I'm assuming the former, but I'm pondering if this is caused by a failed major-version upgrade.
Additionally; Does the site have any local-package set? Look for $wp_local_package = ...
in wp-includes/version.php
.
#32
in reply to:
↑ 31
@
5 months ago
Replying to dd32:
On my side, it's on maintenance&security only :
"This site is automatically kept up to date with maintenance and security releases of WordPress only"
And in wp-includes/version.php
, we have $wp_local_package = 'fr_FR';
#34
@
4 months ago
site - rehab ilitace org (now fixed by quickfix from @arnaudj to wp-load.php that solve olny public site, but wp-admin still error)
error-default-filters.php file: https://wetransfer.com/downloads/5a83292cebe50d1425706b330e1c084b20240626114828/4cbe39e3c3e5cacb76eb5ea7e883daf820240626114828/107444?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid
#35
@
4 months ago
For one site that was affected by this problem, I looked in a backup of an old version of the site.
In that version (v6.2.3), there was a definition of the function _wp_footnotes_kses_init() in the file wp-includes/blocks.php.
So it may be the case that the problem is not that a reference to that function was added in wp-includes/default-filters.php, but that the definition of that function was removed from wp-includes/blocks.php.
That particular site had no wp_local_package line in wp-includes/version.php, and is set to be "automatically kept up to date with maintenance and security releases of WordPress only".
#36
follow-up:
↓ 40
@
4 months ago
It looks like some kind of patching-software might have modified the core files, and now that blocks.php has been reverted due to an update this breaks that modification and thus the site.
#37
@
4 months ago
Please avoid editing wp-load
or other core files, even for a quick fix. I reproduced the errors by replacing the default-filters
file in my local 6.2 installation with the file from comment:25, and then I removed the Footnotes block actions in a custom plugin (as must-use so it did not need activation).
Support forum topics suggested other quick fixes, too, and the WordPress.com forum topic mentions re-downloading core to correct the issue.
#38
@
4 months ago
For a possible patch, I could suggest checking that the function exists before adding the actions.
if ( function_exists( '_wp_footnotes_kses_init' ) ) { add_action( 'init', '_wp_footnotes_kses_init' ); add_action( 'set_current_user', '_wp_footnotes_kses_init' ); }
Without knowing how those hooks were added to the default-filters
file in older versions, however, I am not highly confident that any site trying to call the function in some way would get that update too.
This ticket was mentioned in Slack in #core by jorbin. View the logs.
4 months ago
#40
in reply to:
↑ 36
;
follow-up:
↓ 41
@
4 months ago
Replying to greenlightsolutions:
For one site that was affected by this problem, I looked in a backup of an old version of the site.
In that version (v6.2.3), there was a definition of the function _wp_footnotes_kses_init() in the file wp-includes/blocks.php.
The function has only existed in WordPress 6.3+, introduced to the branch in [56848].
Replying to tomsommer:
It looks like some kind of patching-software might have modified the core files, and now that blocks.php has been reverted due to an update this breaks that modification and thus the site.
This is my best guess as well. Possibly a host-level security patcher. However, that doesn't make much sense to me..
The reason it doesn't make much sense, is that in the event that a core file is modified, WordPress doesn't use the "partial" zip files and instead uses the full release ZIP for that version. That would overwrite any modified files.
My best guess is that the patching software has run immediately following the upgrade. That would explain it I guess.
I'd be curious on the timing of the upgrade + fatals experienced, was it the same second, or a few minutes following, etc.
Having reviewed the logs for post-update notifications from core (WordPress sends some statistical data, and by knowing the URL of an affected site I can infer which logs are from which site, as the user-agent forms part of a unique key hash), the sites mostly used partial zips to upgrade, and appears to have run successfully. It appears that at least one probably used a full ZIP (not a partial) as it took 10x longer to upgrade than the rest, but also didn't report any issues.
#41
in reply to:
↑ 40
@
4 months ago
Replying to dd32:
This is my best guess as well. Possibly a host-level security patcher. However, that doesn't make much sense to me..
The reason it doesn't make much sense, is that in the event that a core file is modified, WordPress doesn't use the "partial" zip files and instead uses the full release ZIP for that version. That would overwrite any modified files.
I see, okay - well then none of this makes any sense, if all files are overwritten on upgrade then the timestamp of default-filters.php should be recent.
My best guess is that the patching software has run immediately following the upgrade. That would explain it I guess.
Doubt that, based on mtime timestamps the modifications are often years old.
#42
@
4 months ago
I have an open support ticket at WordPress.org on this issue.
https://wordpress.org/support/topic/site-not-working-after-auto-update/
#43
@
4 months ago
I found the root cause for this bug affecting the upgrade to 6.1.7 from 6.1.6.
https://wordpress.org/support/topic/site-not-working-after-auto-update/#post-17855455
#44
follow-up:
↓ 46
@
4 months ago
We have some client websites that were concerned by this issue. I have found out that bad a patch was applied by Patchman. On the website I looked at (version 6.2.6), the following lines were added, but _wp_footnotes_kses_init only exist since version 6.3.2
// Footnotes Block. add_action( 'init', '_wp_footnotes_kses_init' ); add_action( 'set_current_user', '_wp_footnotes_kses_init' ); add_filter( 'force_filtered_html_on_import', '_wp_footnotes_force_filtered_html_on_import_filter', 999 );
This ticket was mentioned in Slack in #core by benoitchantre. View the logs.
4 months ago
#46
in reply to:
↑ 44
@
4 months ago
Replying to benoitchantre:
We have some client websites that were concerned by this issue. I have found out that bad a patch was applied by Patchman. On the website I looked at (version 6.2.6), the following lines were added, but _wp_footnotes_kses_init only exist since version 6.3.2
My name is Jelmer Verkleij, I am the Director of Engineering for Patchman and have been investigating problems reported to us related to these automated patches for the last week. Unfortunately I can't find a report you made in our support tracker, so I am going off limited information for your specific case.
We have not been able to identify any Patchman-triggered patch introducing such changes yet. Can you please contact the main Patchman support channel (https://cloudlinux.zendesk.com/hc/en-us/requests/new) with details of which website this concerns so we can debug the issue with you? If we can indeed trace this issue you report to a Patchman patch, we will of course retract and revert that patch immediately.
#47
@
4 months ago
@benoitchantre With the help of another customer who provided us debugging information, the root cause was identified.
The situation here is that this patch is part of a set of patches applied to older versions of WordPress to address an XSS vulnerability in the footnotes block. This patch was released alongside one that introduces the referenced function in blocks.php. The patches were released on 19 October 2023 and never caused any problems.
However, with the release of these newer patch versions, the default-filters.php was left untouched while blocks.php was overwritten. This caused the reference to remain but the referenced function to disappear. The same would happen in case Patchman newly detected files in this new version with partial matching: we match by file contents, not by installation version (this has proven to be significantly less error-prone in the past) and because of this, the file default-filters.php matching our expected contents for 6.1 - 6.1.6 means the patch was applicable by extrapolation.
Patchman as a product functions because updates are almost universally executed with full file overwrites, and the fixes we introduce are based on official updates towards the version that website owners usually update to. Partial updates generally involve all the files we touch. This particular flow is different because:
a) this is a partial update
b) the update in question didn't in fact cover a vulnerability that was previously considered a vulnerability by the WordPress team in a different release
c) the update was introduced long after our patches were developed and tested (and proven to be safe with every WordPress version released at that stage), thus circumventing our standard QA procedure
The odd set of circumstances has also meant that our debugging flow had to start from scratch, removing every single experience we've had with patching websites in well over a decade, in order to find out how our changes relate to the problems seen. Unfortunately, that has slowed down our ability to respond accurately to your very real problem of websites being broken. However, with help provided to us through various channels, we were able to piece together the order of events and - most importantly - what steps we can take to remediate this.
We are currently working on modifications to our vulnerability patches that will address this particular problem in a way that is safe for every installation, regardless of its upgrade path, and expect to publish those through our software within the next several hours. In order to get this executed as quickly as possible upon that release, please refer to the way your hosting provider has configured Patchman for your website, as this can be configured as your provider sees fit.
We shall also work on monitoring these partial updates as they are released in the future to better respond in cases where such partial rollouts cause problems as this one does.
For any specific questions about particular cases, please feel free to refer to our customer support portal as referenced in my previous post.
#48
@
4 months ago
@jelmerverkleij Thank you for your feedbacks, detailed analysis and clear communication. I understand that you have got enough information to provide a solution. If not, I have some websites that were affected by this issue that I have not yet worked on. Let me know if you need more information. Before posting here, I sent a detailed report to my host (Infomaniak).
#49
@
4 months ago
- Keywords reporter-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Severity changed from critical to normal
- Status changed from new to closed
@jelmerverkleij Thank you for following up and helping the WordPress team and folks on this ticket work out the issue.
Additionally, thank you to all the people affected for your time as the root cause was worked out. I know how stressful it is when sites go down, especially in an agency context and it's happening to multiple sites you manage. Being generous with your time after the event is a credit to you all.
As it appears the bug was from another service provider, I'm going to close this ticket as works for me to indicate that the WordPress packages worked as expected.
Closing a ticket doesn't lock if from further comments so if you need to discuss this issue further, feel free to do so.
Thanks again, everyone.
#50
@
4 months ago
The amended patches in Patchman went live to our customers roughly 22 hours ago, and we have closely monitored the rollout. All cases reported to us have now been confirmed to us as fixed. If anyone is continuing to have problems, please check with your hosting provider (or through your hosting panel) whether the newest patches have been applied yet - this is dependent on how your provider has configured the automation in our product.
When in doubt, feel free to reach out directly to the Patchman customer support department so we can handle your case outside of this tracker.
Once again, I would like to apologise to all website owners affected for this chain of events; our goal is always to perform our function without affecting functionality of websites, and this novel flow made this a challenging new case for us. This is clearly something that we should amend our processes for to prevent this from happening in the future, and we always aim to improve.
Here is the stack trace:
[24-Jun-2024 21:05:49 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "_wp_footnotes_kses_init" not found or invalid function name in /wp-includes/class-wp-hook.php:308
Stack trace: