Update dependency craftcms/cms to ^4.7.0 [SECURITY] #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^4.0.0->^4.7.0GitHub Vulnerability Alerts
CVE-2022-37250
Craft CMS 4.2.0.1 suffers from Stored Cross Site Scripting (XSS) in
/admin/myaccount.CVE-2022-37248
Craft CMS 4.2.0.1 is vulnerable to Cross Site Scripting (XSS) via
src/helpers/Cp.php.CVE-2022-37251
Craft CMS
3.70-RC1–3.7.55.1and4.0.0-RC1–4.2.0.1are vulnerable to Cross Site Scripting (XSS) via entry revisions and drafts. Versions3.7.55.2and4.2.1contain patches for this issue.CVE-2022-37247
Craft CMS 4.2.0.1 is vulnerable to stored a cross-site scripting (XSS) via /admin/settings/fields page.
CVE-2022-37246
Craft CMS 4.2.0.1 is affected by Cross Site Scripting (XSS) in the file src/web/assets/cp/src/js/BaseElementSelectInput.js and in specific on the line
label: elementInfo.label.CVE-2023-23927
Summary
When you insert a payload inside a label name or instruction of an entry type, an XSS happens in the quick post widget on the
admin dashboard.
PoC
2023-01-30.18-43-49.mp4
Impact
Tested with the free version of Craft CMS 4.3.6.1
CVE-2023-31144
A malformed title in the feed widget of craftcms/cms can deliver an XSS payload. This has been resolved in this commit.
CVE-2023-32679
Summary
Unrestricted file extension lead to a potential Remote Code Execution
(Authenticated, ALLOW_ADMIN_CHANGES=true)
Details
Vulnerability Cause :
If the name parameter value is not empty string('') in the View.php's doesTemplateExist() -> resolveTemplate() -> _resolveTemplateInternal() -> _resolveTemplate() function, it returns directly without extension verification, so that arbitrary extension files are rendered as twig templates (even if they are not extensions set in defaultTemplateExtensions = ['html', 'twig'])
When attacker with admin privileges on the DEV or Misconfigured STG, PROD, they can exploit this vulnerability to remote code execution (ALLOW_ADMIN_CHANGES=true)
PoC
Step 1) Create a new filesystem. Base Path: /var/www/html/templates

Step 2) Create a new asset volume. Asset Filesystem: template

Step 3) Upload poc file( .txt , .js , .json , etc ) with twig template rce payload
{{'<pre>'}} {{1337*1337}} {{['cat /etc/passwd']|map('passthru')|join}} {{['id;pwd;ls -altr /']|map('passthru')|join}}Step 4) Create a new global set with template layout. The template filename is poc.js

Step 5) When access global menu or /admin/global/test, poc.js is rendered as a template file and RCE confirmed

Step 6) RCE can be confirmed on other menus(Entries, Categories) where the template file is loaded.


Poc Environment) ALLOW_ADMIN_CHANGES=true, defaultTemplateExtensions=['html','twig']



Impact
Take control of vulnerable systems, Data exfiltrations, Malware execution, Pivoting, etc.
Additionally, there are 371 domains using CraftCMS exposed on Shodan, and among them, 33 servers have "stage" or "dev" included in their hostnames.
although the vulnerability is exploitable only in the authenticated users, configuration with ALLOW_ADMIN_CHANGES=true, there is still a potential security threat (Remote Code Execution)
Remediation
Recommend taking measures by referring to https://github.com/craftcms/cms-ghsa-9f84-5wpf-3vcf/pull/1
CVE-2023-33194
Summary
The platform does not filter input and encode output in Quick Post validation error message, which can deliver an XSS payload.
Details
Old CVE fixed the XSS in label HTML but didn’t fix it when clicking save.
PoC
Login at admin
Go to setting
Create a Section
On Entry page, click Edit label
Inject the XSS payload into the label and save
On the admin dashboard choose new widget -> Quick Post
In Quick Post, click save with blank slug; The XSS will be executed
"errors":{"title":["<script>alert('nono')</script> cannot be blank."],"slug":["Slug cannot be blank."]
Fixed in craftcms/cms@9d0cd0b
CVE-2023-33196
Summary
XSS can be triggered by review volumes
PoC
Root cause
Function: index.php?p=admin/actions/asset-indexes/process-indexing-session&v=1680710595770
After loading completed, progess will load:
"skippedEntries"
and
"missingEntries"
These parameters is not yet filtered, I just tried "skippedEntries" but I think it will be work with "missingEntries"
My reponse:
{
"session": {
"id": 10,
"indexedVolumes": {
"6": ""<script>alert(1337)</script>"
},
"totalEntries": 2235,
"processedEntries": 2235,
"cacheRemoteImages": true,
"listEmptyFolders": false,
"isCli": false,
"actionRequired": true,
"dateCreated": "Apr 5, 2023, 9:03:16 AM",
"skippedEntries": [
""<script>alert(1337)</script>/assetpreviews/Image.php",
""<script>alert(1337)</script>/assetpreviews/Pdf.php"
],
"missingEntries": {
"folders": [],
"files": []
},
"processIfRootEmpty": false
},
"skipDialog": false
}
Resolved in craftcms/cms@053d711
CVE-2023-33197
Summary
XSS can be triggered via the Update Asset Index utility
PoC
XSS will be triggered
Json response volumes name makes triggers the payload
It’s run on every POST request in the utility.
Resolved in craftcms/cms@8c2ad0b
CVE-2023-2817
A post-authentication stored cross-site scripting vulnerability exists in Craft CMS versions <= 4.4.11. HTML, including script tags can be injected into field names which, when the field is added to a category or section, will trigger when users visit the Categories or Entries pages respectively. This issue was patched in version 4.4.12.
CVE-2023-40035
Summary
Bypassing the validatePath function can lead to potential Remote Code Execution
(Post-authentication, ALLOW_ADMIN_CHANGES=true)
Details
In bootstrap.php, the SystemPaths path is set as below.
Because paths are validated based on the /path1/path2 format, this can be bypassed using a file URI scheme such as file:///path1/path2. File scheme is supported in mkdir()
ref. https://www.php.net/manual/en/wrappers.file.php
PoC
{{'<pre>'}} {{1337*1337}} {{['cat /etc/passwd']|map('passthru')|join}} {{['id;pwd;ls -altr /']|map('passthru')|join}}PoC Env
Impact
Take control of vulnerable systems, Data exfiltrations, Malware execution, Pivoting, etc.
although the vulnerability is exploitable only in the authenticated users, configuration with ALLOW_ADMIN_CHANGES=true, there is still a potential security threat (Remote Code Execution)
CVE-2023-41892
Impact
This is a high-impact, low-complexity attack vector. Users running Craft installations before 4.4.15 are encouraged to update to at least that version to mitigate the issue.
Mitigations
php craft setup/security-keycommand and copying the updatedCRAFT_SECURITY_KEYenvironment variable to all production environments.php craft resave/users --set passwordResetRequired --to "fn() => true".References
craftcms/cms@c0a37e1#diff-47dd43d86f85161944dfcce2e41d31955c4184672d9bd9d82b948c6b01b86476
craftcms/cms@7359d18
craftcms/cms@a270b92
https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#4415---2023-07-03-critical
CVE-2024-21622
Impact
This is a potential moderate impact, low complexity privilege escalation vulnerability in Craft with certain user permissions setups.
Patches
This has been fixed in Craft 4.4.16 and Craft 3.9.6. Users should ensure they are running at least those versions.
References
https://github.com/craftcms/cms/pull/13932
https://github.com/craftcms/cms/pull/13931
https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#4511---2023-11-16
https://github.com/craftcms/cms/blob/v3/CHANGELOG.md#396---2023-11-16
CVE-2023-36260
An issue discovered in Craft CMS version 4.6.1.1 allows remote attackers to cause a denial of service (DoS) via crafted string to Feed-Me Name and Feed-Me URL fields due to saving a feed using an Asset element type with no volume selected.
Release Notes
craftcms/cms (craftcms/cms)
v4.7.0Compare Source
Content Management
Administration
utils/prune-orphaned-matrix-blockscommand. (#14154)Extensibility
craft\base\ElementInterface::beforeDeleteForSite().craft\base\ElementInterface::afterDeleteForSite().craft\base\FieldInterface::beforeElementDeleteForSite().craft\base\FieldInterface::afterElementDeleteForSite().System
phpsessionstable, if it exists. (#13589)auto_positionplugin. (#14160)craft\web\CpScreenResponseBehavior::editUrl()weren’t getting resolved to absolute URLs.v4.6.1Compare Source
craft\log\MonologTargetinstances are now created viaCraft::createObject(). (#13341)craft\helpers\Db::prepareValueForDb()wasn’t converting objects to arrays for JSON columns.0options within element indexes or condition rules. (#14127, #14143)craft\db\Migration::renameTable()was renaming the table for the primary database connection, rather than the migration’s connection. (#14131)Craft.FormObserverwasn’t working reliably for non-<form>containers.v4.6.0Compare Source
Content Management
Administration
disabledUtilitiesconfig setting. (#14044)showFirstAndLastNameFieldsconfig setting. (#14097)resavecommands now pass an empty string ('') to fields’normalizeValue()methods when--tois set to:empty:. (#13951)sections/createcommand now supports--name,--handle,--type,--no-versioning,--uri-format, and--templateoptions, and can now be run non-interactively. (#13864)index-assets/oneandindex-assets/allcommands now accept a--delete-empty-foldersoption. (#13947)Extensibility
craft\base\conditions\ConditionRuleInterface::getLabelHint().craft\helpers\AdminTable::moveToPage(). (#14051)craft\helpers\App::dbMutexConfig().craft\helpers\ElementHelper::searchableAttributes().craft\services\Elements::setElementUri().craft\services\Elements::EVENT_SET_ELEMENT_URI. (#13930)craft\services\Search::createDbQuery().craft\base\MemoizableArraynow supports passing a normalizer method to the constructor, which will be lazily applied to each array item once, only if returned byall()orfirstWhere(). (#14104)craft\elements\actions\DeleteAssetsis no longer deprecated.craft\helpers\ArrayHelper::firstWhere()now has a$valueKeyargument, which can be passed a variable by reference that should be set to the resulting value’s key in the array.craft\helpers\App::mutexConfig().Craft.FormObserver. (#14114)footerActions,moveToPageAction,onCellClicked,onCellDoubleClicked,onRowClicked,onRowDoubleClicked, andpaginatedReorderActionsettings. (#14051)System
queue/get-job-infoaction requests no longer create a mutex lock.mutexdriver is now set toyii\mutex\MysqlMutexoryii\mutex\PgsqlMutexby default, once again. (#14102)v4.5.15Compare Source
craft\helpers\DateTimeHelper::nextYear()andlastYear()weren’t returning the correct dates. (#14109)maxCachedCloudImageSizewas set to0. (#14100)craft\fields\BaseRelationField::normalizeValue()wasn’t retaining eager-loaded values. (#14117)v4.5.14Compare Source
relatedToAssets,relatedToCategories,relatedToEntries,relatedToTags, andrelatedToUsersare now reserved user field handles. (#14075)craft\services\Security::$sensitiveKeywordsis no longer case-sensitive. (#14064)index-assets/cleanupcommand accepted--cache-remote-images,--create-missing-assets, and--delete-missing-assetsoptions, even though they didn’t do anything.craft\web\Request::getIsPreview()was returningtruefor requests with expired tokens. (#14066)index-assets/onecommand was overly-destructive when run with a subpath and the--delete-missing-assetsoption. (#14087)v4.5.13Compare Source
autocompletevalues when editing an address that belongs to the current user. (#13938)|markdownand|mdfilters now accept anencodeargument, which can be set totrueto HTML-encode the content before parsing it as Markdown.pre-encodedMarkdown flavor, which can be used when the content has already been HTML-encoded.craft\elements\Address::getBelongsToCurrentUser().{% namespace %}tags weren’t respecting namespaces set to0. (#13943)SCENARIO_CREATE, ifAsset::$tempFilePathwasn’t set. (#14041)v4.5.12Compare Source
autocompletevalues when editing the current user. (#13941)craft\db\Connection::onAfterTransaction().craft\errors\MutexException. (#13985)craft\fieldlayoutelements\TextField::$inputType. (#13988)craft\fieldlayoutelements\TextField::$type.$inputTypeshould be used instead. (#13988)craft\base\ApplicationTrait::onAfterRequest()callbacks weren’t necessarily triggered if anEVENT_AFTER_REQUESThandler got in the way.craft\services\Elements::EVENT_AUTHORIZE_VIEWevent wasn’t always triggered when editing elements. (#13981))autosaveDraftsconfig setting was disabled. (#13921)v4.5.11Compare Source
craft\gql\types\DateTime::$setToSystemTimeZone.craft\gql\types\DateTimenow supports JSON-encoded objects withdate,time, andtimezonekeys.craft\web\Response::setCacheHeaders()now includes thepublicdirective in theCache-Controlheader. (#13922)localizedGraphQL field wasn’t returning any results for drafts or revisions. (#13924)v4.5.10Compare Source
db/drop-table-prefixcommand.owneraddress query param.titleattribute. (#13876)--column-insertstopg_dump.craft\web\AssetManager::$cacheSourcePaths.sortOrdervalues were the same. (#13896)v4.5.9Compare Source
storage/folder existed.v4.5.8Compare Source
focalPointargument to asset save mutations. (#13846)upcommand now accepts a--no-backupoption.{% cache %}tags now store any<meta>tags registered withyii\web\View::registerMetaTag(). (#13832)craft\errors\ExitException.craft\web\View::startMetaTagBuffer().craft\web\View::clearMetaTagBuffer().craft_modify_app_config()function. (#13855){% exit %}tags without a status code weren’t outputting any HTML that had already been output in the template. (#13848)v4.5.7Compare Source
pgpasswordandpwdto the list of keywords that Craft will look for when determining whether a value is sensitive and should be redacted from logs, etc.craft\events\DefineCompatibleFieldTypesEvent.craft\services\Fields::EVENT_DEFINE_COMPATIBLE_FIELD_TYPES. (#13793)craft\web\assets\inputmask\InputmaskAsset.craft\web\Request::accepts()now supports wildcard (e.g.application/*). (#13759)Craft.ElementEditorinstances are now configured with anelementIdsetting, which is kept up-to-date when a provisional draft is created. (#13795)Garnish.isPrimaryClick().defaultDirModeconfig setting wasn’t being respected when thestorage/runtime/andstorage/logs/folders were created. (#13756)transformGifsandtransformSvgsconfig settings weren’t always being respected when using@transformGraphQL directives. (#13808)requirepackages differently than how Composer does it natively, whenconfig.sort-packageswas set totrue. (#13806)v4.5.6Compare Source
autosaveDraftsconfig setting is disabled. (#12348)resave/addressescommand. (#13720)resave/matrix-blockscommand now supports an--owner-idoption.craft\helpers\App::phpExecutable().craft\helpers\Component::cleanseConfig().craft\helpers\Component::createComponent()now filters outas Xandon Xkeys from the component config.craft\services\Announcements::push()now has an$adminsOnlyargument. (#13728)Craft.appendHeadHtml()andappendBodyHtml()now load external scripts asynchronously, and return promises.onQueryParamscallback method wasn’t set. (#13677)CRAFT_DOTENV_PATHenvironment variable was set, or a console command was executed with the--dotenvPathoption. (#13725)craft\services\Elements::saveElement()was called with$runValidationset tofalse.v4.5.5Compare Source
maxGraphqlBatchSizeconfig setting. (#13693)v4.5.4Compare Source
@stripTagsand@trimGraphQL directives. (#9971)SKto the list of keywords that Craft will look for when determining whether a value is sensitive and should be redacted from logs, etc. (#3619)|replaceTwig filter now has aregexargument, which can be set tofalseto disable regular expression parsing. (#13642)craft\events\DefineUserGroupsEvent.craft\services\Users::EVENT_DEFINE_DEFAULT_USER_GROUPS. (#12283)craft\services\Users::getDefaultUserGroups().craft\events\UserAssignGroupEventnow extendsDefineUserGroupsEvent, giving it a new$userGroupsproperty.craft\helpers\DateTimeHelper::toDateTime()now supportsDateTimeImmutablevalues. (#13656)craft\web\Response::setCacheHeaders()no longer includespublicin theCache-Controlheader when$overwriteisfalse. (#13676)craft\events\UserAssignGroupEvent.DefineUserGroupsEventshould be used instead.craft\services\Elements::duplicateElement()now supports passing asiteAttributesarray to the$attributesargument, for setting site-specific attributes.photofield.valuekey. (#13648)typeIdlabels for admin users with “Show field handles in edit forms” enabled. (#13627)transformGifsandtransformSvgsconfig settings weren’t always being respected. (#13624, #13635)filltransform properties weren’t being passed along bycraft\elements\Asset::getUrlsBySize()andgetSrcset(). (#13650)v4.5.3Compare Source
nullvalues astrue.Craft.namespaceId()wasn’t working properly if the namespace ended in a]character.|replaceTwig filter wasn’t identifying regular expressions that contained escaped slashes. (#13618)v4.5.2Compare Source
craft\helpers\UrlHelper::buildQuery()is no longer deprecated. (#12796)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.