Commit graph

8887 commits

Author SHA1 Message Date
Translation updater bot
c129ebd2d2
Localisation updates from https://translatewiki.net.
Change-Id: Id745ce901c7efff83a022e0879125ca9fdebd44a
2025-07-01 07:34:28 +02:00
Dayllan Maza
87ea0c739f SECURITY: Fix autoblocks visibility when bl_deleted=1
CVE-2025-6927

ApiQueryBlock was relying only on the filter returned by
HideUserUtils::getExpression which only works for blocks targeting a
user account

Bug: T397595
Change-Id: I7bbd6ae36a11840ed6b4620b5d07fa5158ff139e
2025-06-30 21:25:30 +01:00
Kunal Mehta
4b59ce1f25 SECURITY: API: Escape i18n messages in action=feedcontributions
CVE-2025-6591

This is the same issue as CVE-2025-32072 (T386175), except in the
API's feedcontributions module. Escape the "Contributions" and
"colon-separator" messages so administrators cannot inject HTML
into them, triggering a potential XSS in feed readers.

Bug: T392276
Change-Id: Ic590a0d0cfc0a4a1e61859ecc57a175a8f5ec098
2025-06-30 19:58:26 +01:00
daniel
db6013aa6c Api: Fix permission checks in action=compare
Why:
- action=compare was used to circumvent Lockdown

What:
- use checkTitleUserPermissions() to enforce read permissions in
  ApiComparePages.

Bug: T397521
Change-Id: Id275382743957004fa7fc56318fc104d8e2d267b
(cherry picked from commit c62e4d93a33e94c7fe6f716a4747b1dbd59b3f90)
2025-06-25 14:17:17 +00:00
Aaron Schulz
4659cbcccc rdbms: fix table prefixing in "FOR UPDATE" clause generation in Postgres
Make SqlPlatform::tableNameWithAlias() include the unqualified table
name as an alias if doing so is not redundant. This assures that the
default alias from JoinGroupBase::addJoin(), equal to the unqualified
table name, will be usable in SQL (regardless of table prefixes).

Clean up use of identifier quotes for sqlite_master tables. The called
methods expect unqualified names and a passthrough exception already
exists for sqlite_* tables.

Use "block_target.bt_user" directly in ApiQueryBlocks and BlockPager,
instead of using addIdentifierQuotes(). The "block_target" alias is
automatically added to the SQL by the rdbms layer when it's not clearly
redundant, so it is always safe to use block_target.bt_user. Also, there
is no reason for aliases to include quote characters. They are supposed
to be simple alphanumerics like column names. This makes it easy for
tableNameWithAlias() to avoid redundant aliases by checking tableName().

Avoid unneeded quotes around pg_catalog.* table names in the Postgres
installer. The relevant documentation of methods like selectField() is
that the table names be unqualified (no quotes nor dots), though dots
are still supported internally for compatibility reasons and ease of
querying schemas like pg_catalog and information_schema.

Change-Id: Ic7d7826da31f49915141692cb3bd84ed1e872e96
2025-06-24 22:33:30 +01:00
Translation updater bot
38a0f5d5e9
Localisation updates from https://translatewiki.net.
Change-Id: If2a15063f338e83caea4b85b0b87d67defbe80b4
2025-06-24 07:33:27 +02:00
Translation updater bot
5e27e3d4c9
Localisation updates from https://translatewiki.net.
Change-Id: Id506abba0a9655c6e4d23cf2f901db8e97312661
2025-06-17 07:32:55 +02:00
Reedy
a18e6ca5e6 ApiQueryRevisionsBase: Cast ctype_digit() param to string
Bug: T396766
Change-Id: I22f65e63269ad985f2442176387f2ca96f7609c5
(cherry picked from commit dddeb4e16fae4bae9cd5183548e6db7b3eff2b07)
2025-06-16 14:29:08 +00:00
Translation updater bot
d5e97d42ac
Localisation updates from https://translatewiki.net.
Change-Id: Id5113b17063ac0d61bc9ab3638814ad4d6e13e8e
2025-06-10 07:33:07 +02:00
Translation updater bot
834c1a5407
Localisation updates from https://translatewiki.net.
Change-Id: Ia44339c067661faed77d8b6b7670a62fc47589ba
2025-06-03 07:32:43 +02:00
Translation updater bot
cd0e100668
Localisation updates from https://translatewiki.net.
Change-Id: Id38b320980cd8e7d74dbb82b050ee2713bc26188
2025-05-27 07:32:17 +02:00
Translation updater bot
f418b5f3bf
Localisation updates from https://translatewiki.net.
Change-Id: I8029829a52e7292222f61338bd41d6be924d52e5
2025-05-20 07:33:43 +02:00
Translation updater bot
b7432b90c0
Localisation updates from https://translatewiki.net.
Change-Id: I8263419b865039c2a45179ad5a48d3185b6c71e6
2025-05-13 07:34:39 +02:00
Translation updater bot
5049b1c0d7
Localisation updates from https://translatewiki.net.
Change-Id: I2600f9164717118fac11811f84ad8390bbb9f7ce
2025-05-06 07:33:48 +02:00
Translation updater bot
03d78bbd83
Localisation updates from https://translatewiki.net.
Change-Id: Ib6aba4756c1db49e5e8a4b626eed2b4af06c3231
2025-04-29 07:33:51 +02:00
Translation updater bot
c2b5de68b3
Localisation updates from https://translatewiki.net.
Change-Id: I89e0bab6d19294ff1f993e65df12ccfbea228710
2025-04-22 07:33:11 +02:00
Translation updater bot
0f365d630b
Localisation updates from https://translatewiki.net.
Change-Id: I7757816ae8ab62edf8825b2055bbcab9e9b7c6f8
2025-04-15 07:32:55 +02:00
jenkins-bot
334b860bc7 Merge "block: Fix DBS::acquireTarget() race using GET_LOCK()" into REL1_43 2025-04-08 23:04:22 +00:00
Translation updater bot
ae9f56c1ed
Localisation updates from https://translatewiki.net.
Change-Id: I51b847bec127822655ffbdd08b19bfe05cddcec7
2025-04-08 07:34:00 +02:00
Tim Starling
edea1bc177 block: Fix DBS::acquireTarget() race using GET_LOCK()
A crude solution for the acquireTarget() race condition. Use SQL
GET_LOCK() to lock the target from the acquireTarget() call until the
transaction is committed.

Add FOR UPDATE to the acquireTarget() SELECT, otherwise it just sees the
snapshot version of the row and inserts a new row anyway.

Add a test which reliably failed prior to the change.

Reword the ipb-block-not-found message. This is normal for simultaneous
blocks of the same target. Don't contact us. In the API, remap it to
"alreadyblocked".

Bug: T389028
Change-Id: I1fa35bf08d456a93930194786f77df389217ba61
(cherry picked from commit 2b65587e4d92e7f27661e8821b14f74ade939cfa)
2025-04-07 11:43:34 +00:00
Translation updater bot
9de43c4fca
Localisation updates from https://translatewiki.net.
Change-Id: I8d8f8f876ce596712cfa46ec6d774ad14e5b8c1b
2025-04-01 07:32:43 +02:00
Translation updater bot
50fb129172
Localisation updates from https://translatewiki.net.
Change-Id: I0e3e387ab8ffd8d042bb81165a51ffcd6411e050
2025-03-25 06:33:36 +01:00
Func
06b9aa64b2 Apply proper restrictions on file revert action
Users should have 'reupload' or 'reupload-own' rights to do file revert.

Bug: T304474
Change-Id: I2d0eaeeea237286741708c2b5920fe7cca3acf50
(cherry picked from commit 7b4aee237e257954195c4d695b2cfe2a9a3b4116)
2025-03-24 12:55:44 +00:00
Translation updater bot
b5cdc575de
Localisation updates from https://translatewiki.net.
Change-Id: Iadf6b960fa78aa92aab16b4ea5835d9160237199
2025-03-18 06:31:56 +01:00
James D. Forrester
68329e412d ApiLogin: Don't break BotPasswords if password or user is blank, just error
Bug: T388255
Change-Id: Ibcc20d345cfe7b9410187a74f79f66c8e2326f2f
(cherry picked from commit 953ec56fa2c053fee514468e5710f706ee7c200c)
2025-03-13 18:44:12 +00:00
Translation updater bot
052664c1f0
Localisation updates from https://translatewiki.net.
Change-Id: I7db45053212cc3abc595a82f9136090d09dfceab
2025-03-11 06:32:45 +01:00
Translation updater bot
369b31f5ea
Localisation updates from https://translatewiki.net.
Change-Id: I8efdea63dce69f70911877f8c402daa05247f012
2025-03-04 06:34:04 +01:00
Translation updater bot
3f040e33bd
Localisation updates from https://translatewiki.net.
Change-Id: If360ec9295a3fd250b27dec146e81f205e0c6e54
2025-02-25 06:32:49 +01:00
Translation updater bot
086f0b5236
Localisation updates from https://translatewiki.net.
Change-Id: Ie6671ad9a673374b4d70a6fdfe0447e310d1db56
2025-02-18 06:32:08 +01:00
Translation updater bot
921fcc4d4c
Localisation updates from https://translatewiki.net.
Change-Id: If800b2998c86a9d9333057ccbcfe4e638dfbaca4
2025-02-11 06:32:37 +01:00
Translation updater bot
e00a967d45
Localisation updates from https://translatewiki.net.
Change-Id: If24feed544ade08f7f94ff61566392de84bb6a19
2025-02-04 06:32:24 +01:00
Translation updater bot
0677163554
Localisation updates from https://translatewiki.net.
Change-Id: If3a2f012b033ae6c05d001bb1531cb928044e9c6
2025-01-28 06:31:37 +01:00
Translation updater bot
922ba6c190
Localisation updates from https://translatewiki.net.
Change-Id: Iadbd52cbddf89c6f862d60d9f778c9a891d4010c
2025-01-21 06:32:19 +01:00
Translation updater bot
9530b23ee3
Localisation updates from https://translatewiki.net.
Change-Id: I7c5c2921596e509850cfa828ff4da00e9fbb6ea0
2025-01-14 06:31:37 +01:00
Translation updater bot
cacd3b793b
Localisation updates from https://translatewiki.net.
Change-Id: Ie051918d63ba73144f9a47c262cff016a9da4b88
2025-01-07 06:33:31 +01:00
Translation updater bot
91e434b9ba
Localisation updates from https://translatewiki.net.
Change-Id: I407e678d3272356af61f1aa4501da649e579c42f
2024-12-31 06:32:17 +01:00
Translation updater bot
0974f58a47
Localisation updates from https://translatewiki.net.
Change-Id: I990c03920d6eea71c57cd642fd257d959d328e79
2024-12-24 06:31:59 +01:00
Translation updater bot
28a23b6c17
Localisation updates from https://translatewiki.net.
Change-Id: I3bc5b5e1cf102d5de24e18e207ded1a1eb386c7c
2024-12-17 06:32:12 +01:00
Translation updater bot
243674529e
Localisation updates from https://translatewiki.net.
Change-Id: I63a0d567bfa65b73120645bc5820be2321b6d84f
2024-12-10 06:31:11 +01:00
Translation updater bot
c149a70c0e
Localisation updates from https://translatewiki.net.
Change-Id: Iee6d9a093d36164b67739c76651500c6eff23414
2024-11-26 06:31:54 +01:00
Translation updater bot
d5a793d5a2
Localisation updates from https://translatewiki.net.
Change-Id: Ide69282dbb21c4f1bb12e5ad90444472711cbf19
2024-11-19 06:32:07 +01:00
Translation updater bot
21eaa87821
Localisation updates from https://translatewiki.net.
Change-Id: Ifd10ef063d76695c30c0bc703b955d5c96c2430b
2024-11-12 06:32:03 +01:00
Umherirrender
1b29f07440 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
2024-10-21 20:41:20 +02:00
jenkins-bot
cd7a5998e9 Merge "Make Message and MessageValue compatible" 2024-10-21 15:38:56 +00:00
Translation updater bot
8f3de71b9d
Localisation updates from https://translatewiki.net.
Change-Id: I470b03c872979240806dfd4db6d1b6ca8284a263
2024-10-21 09:01:48 +02:00
jenkins-bot
0adbc57f7b Merge "api: Check for post_max_size on api requests" 2024-10-19 21:59:39 +00:00
jenkins-bot
058b501166 Merge "api: Use type-declaration for string arg in ApiBase::__construct" 2024-10-19 21:52:22 +00:00
Bartosz Dziewoński
9d56257d8c Make Message and MessageValue compatible
Fix two problems that made it difficult to convert between Message
and MessageValue, or to write code that could accept both of them,
as exemplified by the StatusValue class:

* Implement a common interface
* Use the same internal format for message parameters

While these changes should be compatible with most of existing code,
where the authors were courteous enough to simply call methods such
as Message::numParam() and not look inside the values they return,
it is potentially a breaking change for anything that depended on
the formatted params being arrays or accessed their keys.
Example patches: https://gerrit.wikimedia.org/r/q/topic:message-param

Notable changes:

* Message and MessageValue now both implement MessageSpecifier
  (only Message implemented it before).

* Message::numParam() and other static methods for encoding params
  now return MessageParam objects, instead of special arrays.
  Use these MessageParam objects internally in Message.

* Narrow down the return type of MessageSpecifier::getParams() (it
  was just `array`, allowing any type in the array). Narrow down the
  types for Message::params() and MessageValue::params() to match.

* Deprecate MediaWiki\Message\Converter. As a replacement add
  MessageValue::newFromSpecifier(), which is analogous to
  Message::newFromSpecifier(), but without weird legacy edge cases.

* Make StatusValue::getMessages() return MessageValues. Remove code
  that converted between Message and MessageValue, no longer needed.

* Update many type declarations and comments to use MessageSpecifier
  instead of MessageValue, as well as a couple of tests that depended
  on implementation details.

Bug: T358779
Change-Id: I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83
2024-10-19 15:00:07 +02:00
C. Scott Ananian
d6d6343c68 Deprecate OutputPage::{get,set}PreventClickjacking()
This is redundant with the same-named methods on ParserOutput.

Bug: T301020
Change-Id: I60455186e3a6e9b4329ff09e2f7ea920e2e05192
2024-10-17 23:51:39 -04:00
Umherirrender
be1c33e05e api: Check for post_max_size on api requests
php documentation:
If the size of post data is greater than post_max_size, the $_POST and
$_FILES superglobals are empty.

When the action= and format= are not in the GET data,
the help page is returned in html, breaking the clients expected format.

Return api error with http status 413

Bug: T291754
Change-Id: I5906fb6b4412b161b198df0b51e2476e7e1079b8
2024-10-17 18:22:41 +00:00