Page MenuHomePhabricator

Ensure YAML parsing & validation won't get stuck
Closed, ResolvedPublic

Description

We want to ensure that no matter what campaign content the user provides, the YAML parser won't get stuck on it for a long time. The same is true for the validator.

Parser
Validator
  • Added a config array depth limit.

Event Timeline

Found another parser issue, this time it's just an exception, not an infinite loop: https://github.com/symfony/symfony/issues/41688

Change 721568 had a related patch set uploaded (by Ostrzyciel; author: Ostrzyciel):

[mediawiki/extensions/MediaUploader@master] Restrict the maximum depth of campaign config

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

Change 721568 merged by jenkins-bot:

[mediawiki/extensions/MediaUploader@master] Restrict the maximum depth of campaign config

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

As far as I understand the horrible language that is PHP, implementing a timeout for a library function is not really possible. We could restrict the maximum length of the input, but if one wanted to just spam the server with parse requests, they could simply use wikitext, which would be much easier and probably more destructive. Thus, this is not a problem that the extension should be concerned about.

I think what we have now is enough.