Page MenuHomePhabricator

[{exception_id}] {exception_url} Flow\Exception\FlowException from line 397 of /srv/mediawiki/php-1.33.0-wmf.8/extensions/Flow/includes/Block/TopicListBlock.php: The `newest` sort order does not allow the `offset` parameter. Please use `offset-id`



2018-12-12 17:02 <zfilipin@deploy1001> Synchronized php: group1 wikis to 1.33.0-wmf.8 (duration: 00m 50s)


[{exception_id}] {exception_url} Flow\Exception\FlowException from line 397 of /srv/mediawiki/php-1.33.0-wmf.8/extensions/Flow/includes/Block/TopicListBlock.php: The `newest` sort order does not allow the `offset` parameter. Please use `offset-id`.

Event Timeline

zeljkofilipin triaged this task as Unbreak Now! priority.Dec 12 2018, 5:26 PM
zeljkofilipin created this task.
Restricted Application changed the subtype of this task from "Release" to "Task". · View Herald Transcript
Restricted Application added subscribers: Liuxinyu970226, TerraCodes, Aklapper. · View Herald Transcript

I note the errors seem to have stopped on their own at 17:16, and that they were all on mediawikiwiki which is in group 0.

More specifically: Kibana lists the following hit totals for "The `newest` sort order does not allow the `offset` parameter":

17:17 on0

That's low and bursty enough that it could well just have been a user coincidentally doing something odd.

Possibly related? [{exception_id}] {exception_url} Flow\Exception\DataModelException from line 173 of /srv/mediawiki/php-1.33.0-wmf.8/extensions/Flow/includes/Data/Index/TopKIndex.php: Unable to find specified offset in query results

could well just have been a user coincidentally doing something odd.

Oh, indeed. /w/index.php?title=Project:Support_desk&topiclist_limit=10&topiclist_offset=20181210183932&topiclist_offset-dir=fwd&topiclist_sortby=t73WaIqk'));select%20pg_sleep(10);%20--%20

greg set Security to Software security bug.Dec 12 2018, 5:49 PM
greg added a project: acl*security.
greg changed the visibility from "Public (No Login Required)" to "Custom Policy".
greg added a subscriber: greg.

Making a private security issue. Security team, please review.

Based on @Anomie's comments, this is not a train blocker. Thanks Brad.

topiclist_sortby is seen in many (all?) of these . AFAICT the value passed for that param gets passed to Title#getFullURL as the first query argument.

From a handful of URLs I just tested on (based upon T211798#4817815), it looks like the topiclist_sortby param fails for most values, when present within the query string. The drive-by sqli attempts might be a bit of a red herring in this case, as these exceptions appear to be caught and handled outside of any explicit db interaction, at least after a quick glance.



I've set priority to UBN since I thought it was blocking the train. Is it really UBN?

greg lowered the priority of this task from Unbreak Now! to High.Jan 3 2019, 8:06 PM
Catrope added a subscriber: Catrope.

I don't see how this is a security issue. Flow throws these exceptions for any invalid values or parameter combinations, and does not reflect the invalid value back. If the log spam is an issue, we can deal with that.

@Catrope I've noticed this in logs during train. All I care is that the log spam stops. @greg has tagged it for Security review, but I don't know if it happened.

My guess is that @greg tagged it for security because T211798#4817815 showed someone attempting SQL injection and he was being cautious in case the attempt might have succeeded. It looks like Security's answer is in T211798#4818007, which seems to have found no security problem.

@Anomie et al - that's correct, I didn't see anything here that seemed like a legitimate sqli.

greg changed the visibility from "Custom Policy" to "Public (No Login Required)".

Due to this not being user facing the Growth-Team isn't planning to work on it. However, if Operations finds it important, please reach out to let us know.

thcipriani changed the subtype of this task from "Task" to "Production Error".
thcipriani added a subscriber: thcipriani.

Still seen in 1.38.0-wmf.1:

  • 2 errors in 24 hours
  • Same user, same wiki (, same server, same topic
[{reqId}] {exception_url}   Flow\Exception\FlowException: The `updated` sort order does not allow the `offset-id` parameter. Please use `offset`.
from /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/Block/TopicListBlock.php(391)
#0 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/Block/TopicListBlock.php(264): Flow\Block\TopicListBlock->getFindOptions(array)
#1 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/View.php(235): Flow\Block\TopicListBlock->renderApi(array)
#2 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/View.php(71): Flow\View->buildApiResponse(Flow\WorkflowLoader, array, string, array)
#3 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/Actions/FlowAction.php(107): Flow\View->show(Flow\WorkflowLoader, string)
#4 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/Actions/ViewAction.php(27): Flow\Actions\FlowAction->showForAction(string, OutputPage)
#5 /srv/mediawiki/php-1.38.0-wmf.1/extensions/Flow/includes/Actions/FlowAction.php(50): Flow\Actions\ViewAction->showForAction(string)
#6 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(538): Flow\Actions\FlowAction->show()
#7 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(320): MediaWiki->performAction(Article, Title)
#8 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(925): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(559): MediaWiki->main()
#10 /srv/mediawiki/php-1.38.0-wmf.1/index.php(53): MediaWiki->run()
#11 /srv/mediawiki/php-1.38.0-wmf.1/index.php(46): wfIndexMain()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}