Commit graph

7741 commits

Author SHA1 Message Date
Dreamy Jazz 48b26792a9 SECURITY: abusefiltercheckmatch: Check if user can see log details
CVE-2024-PENDING

Why:
* The 'abusefiltercheckmatch' API allows callers to match
  arbitary filter conditions against existing AbuseFilter logs
* The API does not check if the performer has the ability to
  see the log details for the given filter, so can allow a user
  to bypass hidden and protected visibility settings.

What:
* Call AbuseFilterPermissionManager::canSeeLogDetailsForFilter
  before attempting to match a filter against a given AbuseFilter
  log.
* Add a test to verify that this security fix works.

Bug: T372998
Change-Id: I4a2467dc4e0d1f8401d5428a89c7f6d6ebcdfa70
2024-10-01 00:18:55 +01:00
Translation updater bot 4cce1db84a
Localisation updates from https://translatewiki.net.
Change-Id: I08b9f50c67038caa88659aaab4b22ed09c2c15ed
2024-09-30 09:20:19 +02:00
Translation updater bot d82460057d
Localisation updates from https://translatewiki.net.
Change-Id: Id6704a452d914ab1e8772c9da0cf3d5fb9e574d2
2024-09-26 09:19:08 +02:00
Translation updater bot 39299abcd6
Localisation updates from https://translatewiki.net.
Change-Id: I29b382fca7dba5010cc42c7de79b507dd8a081ed
2024-09-25 09:16:37 +02:00
Ed Sanders ddad49f138 Add docs, i18n to eslintignore
Change-Id: I6a3fc8f24cd34e141dda06b55e011facebd23550
2024-09-24 12:40:48 +01:00
Translation updater bot bd85e77d80
Localisation updates from https://translatewiki.net.
Change-Id: Ic3e3f3b931f186c927dda1f15764013d413030fd
2024-09-24 09:28:08 +02:00
Ed Sanders 48b5da806d Add missing typehints
Change-Id: I3003d40e641b1ebfff8fd986a58cbc2c4f8f18d6
2024-09-23 14:25:50 +01:00
STran 51381f0067 Bugfix: Fix minor issues with protected vars logging
- Fix an issue where if a user didn't have view permissions they could
  get the preference check error (a preference they wouldn't have) on
  SpecialAbuseLog
- Fix an issue where the `change-access` hadn't been updated to the used
  disabled/enabled log types
- Fix an issue where a ProtectedVarsAccessLoggerTest test wasn't
  correctly using the data provider data
- Improve naming since ProtectedVarsAccessLogger exists in its own test
  file instead of being a subset of tests on AbuseLoggerTest

Bug: T371798
Change-Id: I53f22855e63d9e1339361a5c9ee7886e0f74714a
2024-09-23 03:42:41 -07:00
Translation updater bot 79a47d01db
Localisation updates from https://translatewiki.net.
Change-Id: I8862ff7552a7e778a508f6a7f55493ee6475e339
2024-09-23 09:20:34 +02:00
Jon Robson 4124d56fd7 Update Selenium tests to obtain correctly element
This change is needed to unblock a change in core to the markup.
(I0195d4b0f790f6595cc626a6db96b4fc6380a0f4). The current markup
in core is loading additional CSS styles to support legacy
markup.

Bug: T360668
Change-Id: I4bd1a8a9d4eda1b3e89d067d6671d3f8bad4f584
2024-09-20 14:40:46 -07:00
Translation updater bot dcf992aa89
Localisation updates from https://translatewiki.net.
Change-Id: I7adbcfdec086f5540b438aaee21812e3ace66297
2024-09-20 09:22:55 +02:00
jenkins-bot f42e8102e9 Merge "Write protected variables access logs to CheckUser if installed" 2024-09-19 11:07:07 +00:00
Translation updater bot 4b7f3d95f1
Localisation updates from https://translatewiki.net.
Change-Id: I67ade969cd49e41a5b27f29e1fab8644dba3853d
2024-09-19 09:17:42 +02:00
STran 0b3d0b3b6d Write protected variables access logs to CheckUser if installed
Write logs related to temporary accounts to CheckUser if the extension
is available so that logs are topically centralized.

Bug: T373525
Depends-On: I35d50df7cd6754e29d964cc716fb3c42406272df
Change-Id: Ic95f211f4db7ce6dc2d769d2f3af206f4a3935e4
2024-09-18 07:59:05 -07:00
Translation updater bot 51971686fb
Localisation updates from https://translatewiki.net.
Change-Id: I375744ce6f03960675ff928a3827b808e68862f1
2024-09-18 09:18:20 +02:00
Translation updater bot 57d4fac147
Localisation updates from https://translatewiki.net.
Change-Id: I3a5f01aa84c050fcbc3a77fd7dad95bd376a4eb4
2024-09-17 09:26:10 +02:00
Translation updater bot 8fd76d2332
Localisation updates from https://translatewiki.net.
Change-Id: I4bd616bc4c83f337c211d21911bd6090003ae1f9
2024-09-16 09:24:30 +02:00
Matěj Suchánek 3ec6902f41 Make PreferencesHandler implement the hook interface
Follow-up to Ic7024d9c5f369eb33c4198a59638de9a1d58b04b.

Change-Id: I143dc53806eda8424440803833ef2a25b2893d1d
2024-09-13 18:45:30 +02:00
jenkins-bot 2ef2257922 Merge "Log changes to protected variables access" 2024-09-13 12:49:19 +00:00
jenkins-bot 4f272aeb02 Merge "Add preference for viewing protected variables in AbuseFilter" 2024-09-13 12:27:36 +00:00
STran cbfaaa591d Log changes to protected variables access
Similar to how CheckUser logs access to IP information about temporary
accounts, AbuseFilter needs to log whenever protected variables are
accessed.

- Implement ProtectedVarsAccessLogger which handles access logging
- Log whenever a user changes their ability to access protected
  variables via Special:Preferences

Bug: T371798
Change-Id: Ic7024d9c5f369eb33c4198a59638de9a1d58b04b
2024-09-13 01:39:09 -07:00
STran bd819b98a2 Add preference for viewing protected variables in AbuseFilter
Users need to enable a preference before gaining access to the IPs
from `user_unnamed_ip`, a protected variable.

- Add a preference that the user can check to toggle their access
- Check for the preference and the view right for logs that reveal
  protected variables on:
  + AbuseFilterViewExamine
  + SpecialAbuseLog
  + QueryAbuseLog

Bug: T371798
Change-Id: I5363380d999118982b216585ea73ee4274a6eac1
2024-09-12 07:59:24 -07:00
jenkins-bot 14a882513b Merge "tests: Use multi-row insert in AbuseFilterConsequencesTest" 2024-09-11 19:10:26 +00:00
Bartosz Dziewoński b0c9bdc177 Specify caller in DB queries
Found warnings about this in WMF production logs.

Change-Id: I5d47b0b1a15ab68e2fe2b2f5d14eb0c355b0b632
2024-09-11 15:20:11 +02:00
Umherirrender b2df776f8d tests: Use multi-row insert in AbuseFilterConsequencesTest
Small performance benefit by just one db call instead of multiple
Most test cases only use one filter, but some 2 to 4

Change-Id: I498c447e3873d2138e21541467115c9a67bb909e
2024-09-10 22:04:50 +02:00
Translation updater bot db83369b76
Localisation updates from https://translatewiki.net.
Change-Id: Ia93dfb0609ba11b8e104f5ddeb84e756cb175555
2024-09-10 09:27:58 +02:00
jenkins-bot ef65f54c96 Merge "Support named capturing groups in get_matches()" 2024-09-09 18:06:18 +00:00
Translation updater bot 1109691adc
Localisation updates from https://translatewiki.net.
Change-Id: I65c16f2cb739a4bd69467cf11421db5d32780008
2024-09-09 09:21:48 +02:00
Anne Haunime 69ea21dc99 Support named capturing groups in get_matches()
AF rules don't support associative arrays, so the named capturing groups are provided in the array only by their numeric keys.

Bug: T374294
Change-Id: I53b39917e6677f3a5b8f68bcf0faebf48668ea27
2024-09-07 11:25:48 +00:00
Erik Bernhardson 65c10f5fa0 Skip auth checks when autocreate is allowed by provider
Session providers can provide a `canAlwaysAutocreate` flag which
indicates account creation is exempt from autocreate permission
checks. This is used, for example, for providers that provide
users for supporting applications in a wiki farm.

Check the flag and exempt the auto creation from abuse filter
checks as well.

Bug: T373778
Change-Id: Id89358930b92cb8dd05c2b031e764412ee641269
2024-09-05 11:17:16 -07:00
jenkins-bot db67b31db2 Merge "Log entry IDs should not have thousands separators" 2024-09-05 08:00:34 +00:00
Translation updater bot 6c4364688d
Localisation updates from https://translatewiki.net.
Change-Id: I10e3efd76ea3b882d7409bf676400631763e49f2
2024-09-05 09:21:38 +02:00
Translation updater bot 98e0d56cb2
Localisation updates from https://translatewiki.net.
Change-Id: I3a1ea7085072f21f331dc908b121b1e3455c0305
2024-09-04 09:15:49 +02:00
Translation updater bot b4c32f4757
Localisation updates from https://translatewiki.net.
Change-Id: I7da53722156626ac32f2da20890d210e3737a3cd
2024-09-02 09:19:57 +02:00
Translation updater bot ccb5faf096
Localisation updates from https://translatewiki.net.
Change-Id: I6c95dadb2bfb316b078acc694d44d0ee9a52fd7e
2024-08-30 09:19:27 +02:00
Translation updater bot 35a479117f
Localisation updates from https://translatewiki.net.
Change-Id: I461ca3136848f5f2d0489c4eb361e610eaa02fcc
2024-08-29 09:17:08 +02:00
Translation updater bot 8a8da638d3
Localisation updates from https://translatewiki.net.
Change-Id: Ief9e8cee08eb09bb9d3aea036dd382dc9a79d322
2024-08-28 09:36:23 +02:00
Dreamy Jazz aee25cfdaf Allow consequence to be used without pattern in SearchFilters.php
Why:
* The SearchFilters.php maintenance script fails to produce any
  filters when the --pattern option is not provided
* This is because the condition that checked for a missing pattern
  did this after it was passed through ::addQuotes, which made
  the value always truthy.

What:
* Fix this bug, so that the --consequence option can be provided
  without the --pattern option.

Bug: T373148
Change-Id: I316d3f940a8e7616a56040077a20563ee653515b
2024-08-27 11:19:56 +01:00
Translation updater bot 07ed4eab2d
Localisation updates from https://translatewiki.net.
Change-Id: I13109ddba997422622635432d41e431e5bb1bc23
2024-08-27 09:46:40 +02:00
Translation updater bot f4511f7c2e
Localisation updates from https://translatewiki.net.
Change-Id: I03005ac6897457ef5939d0f80c00b6e53dfbf6c5
2024-08-26 09:21:12 +02:00
libraryupgrader 7c7071135c build: Updating micromatch to 4.0.8
* https://github.com/advisories/GHSA-952p-6rrq-rcjv

Change-Id: I4e2581ab81cc444416737c4a3a6c7dc83c34c512
2024-08-24 14:37:14 +00:00
jenkins-bot b231116380 Merge "Api: Avoid type error in AbuseLogPrivateDetails" 2024-08-23 15:00:36 +00:00
Dreamy Jazz 7ecc204050 Expand SearchFilters.php to search by consequence
Why:
* SearchFilters.php allows the caller to search by a regex that
  is applied to the pattern.
* This script can be expanded to allow callers to specify what
  consequence should be associated with the filters that are
  outputted.

What:
* Add a 'consequence' option to the SearchFilters.php maintenance
  script, which is applied through a LIKE query on the
  af_actions column.
** This can be specified with or without the pattern option.
** Instead of making pattern required, the script now requires
   that one of consequence or pattern is provided.
* Expand the tests for the script for this new code, along with
  using the new ::expectCallToFatalError method to be able to
  test previously untestable code.

Bug: T373148
Change-Id: I1b507d8f9dc1f4cf91ee4f83ccde745eb6d46d6d
2024-08-22 22:07:37 +01:00
Translation updater bot 86d4fed611
Localisation updates from https://translatewiki.net.
Change-Id: I48c176b418b68f03165d418e71788e9484c08931
2024-08-22 09:21:19 +02:00
Daimona Eaytoy dcc271b636 Api: Avoid type error in AbuseLogPrivateDetails
Make the `reason` parameter default to the empty string, so that we
don't end up passing null to ManualLogEntry::setComment.

Bug: T373010
Change-Id: Ifca828401628368bdddae14df2bbeb7391b2c02d
2024-08-21 14:31:46 +02:00
Translation updater bot f65ed2b7a1
Localisation updates from https://translatewiki.net.
Change-Id: I85791770e79b28a51a1ab7fb443843ec191c30f5
2024-08-21 09:22:25 +02:00
Translation updater bot 59cba70091
Localisation updates from https://translatewiki.net.
Change-Id: I3caa780c4d8fd0b3bde155f9cac96015cfcf4cb9
2024-08-20 09:40:52 +02:00
Translation updater bot f84ae293a7
Localisation updates from https://translatewiki.net.
Change-Id: I0bd93af961c8a19ab595c47419baebe859ebfb10
2024-08-19 09:21:21 +02:00
jenkins-bot 1aeca2e6b7 Merge "Replace gettype() with get_debug_type() in exception messages etc." 2024-08-16 10:39:46 +00:00
Translation updater bot b895b6e260
Localisation updates from https://translatewiki.net.
Change-Id: Icbb7f095f8e900bd543da07fd96a07781c33f260
2024-08-16 09:27:04 +02:00