Page MenuHomePhabricator

Some parser errors are not reported by the syntax check
Closed, ResolvedPublic

Description

Going to Special:AbuseFilter/tools and running a "check syntax" on the following snippet:

accountname rlike "("

results in no error, but the regexp is obviously wrong. I suspect this happens because the regex is validated when the LHS is not DUNDEFINED, and accountname in this case is.


Update: This happens for invalid regexps (in (i)rlike and rcount), and invalid IP ranges passed to ip_in_range

Details

Related Gerrit Patches:
mediawiki/extensions/AbuseFilter : masterBetter handling of keywords and functions
mediawiki/extensions/AbuseFilter : masterMake to sure to report division by zero when the LHS is undefined

Event Timeline

Daimona created this task.Oct 1 2019, 3:38 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 1 2019, 3:38 PM
Daimona claimed this task.Oct 1 2019, 3:38 PM
Daimona triaged this task as High priority.

Change 540165 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Better handling of keywords and functions

https://gerrit.wikimedia.org/r/540165

Daimona renamed this task from Regex error not reported by the syntax check to Some parser errors are not reported by the syntax check.Oct 1 2019, 4:36 PM
Daimona updated the task description. (Show Details)
Krinkle added a subscriber: Krinkle.Oct 1 2019, 4:46 PM

To confirm - did these ever work in recent history? Presumably these fail unconditionally in a way that filter is effectively disabled / never matches. Is that correct?

They stopped working as of the DUNDEFINED update that happened a while ago. Those filters error out and never match, yes.

Change 549567 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Make to sure to report division by zero when the LHS is undefined

https://gerrit.wikimedia.org/r/549567

Change 540165 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Better handling of keywords and functions

https://gerrit.wikimedia.org/r/540165

Change 549567 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Make to sure to report division by zero when the LHS is undefined

https://gerrit.wikimedia.org/r/549567

Daimona closed this task as Resolved.Nov 8 2019, 7:52 PM