Fix rpsystem inefficient regex

This commit is contained in:
Griatch 2024-03-17 09:25:04 +01:00
parent 51500ad009
commit 3a0b434e42
5 changed files with 12 additions and 4 deletions

View file

@ -37,6 +37,7 @@
account (Griatch) account (Griatch)
- [Fix][issue4311]: SSH connection caused a traceback in protocol (Griatch) - [Fix][issue4311]: SSH connection caused a traceback in protocol (Griatch)
- Fix: Resolve a bug when loading on-demand-handler data from database (Griatch) - Fix: Resolve a bug when loading on-demand-handler data from database (Griatch)
- Security: Potentially O(n2) regex exploit in rpsystem regex (Griatch)
- Doc fixes (iLPdev, Griatch, CloudKeeper) - Doc fixes (iLPdev, Griatch, CloudKeeper)
[pull3420]: https://github.com/evennia/evennia/pull/3420 [pull3420]: https://github.com/evennia/evennia/pull/3420

View file

@ -2,6 +2,11 @@
## Evennia Main branch ## Evennia Main branch
- Feature: Support Python 3.12 (Griatch). Currently supporting 3.10,3.11 and
3.12. Note that 3.10 support will be removed in a future release.
- Feature: Update `evennia[extra]` scipy dependency to 1.12 to support latest
Python. Note that this may change which (equivalent) path is being picked when
following an xyzgrid contrib pathfinding.
- Feature: *Backwards incompatible*: `DefaultObject.get_numbered_name` now gets object's - Feature: *Backwards incompatible*: `DefaultObject.get_numbered_name` now gets object's
name via `.get_display_name` for better compatibility with recog systems. name via `.get_display_name` for better compatibility with recog systems.
- Feature: *Backwards incompatible*: Removed the (#dbref) display from - Feature: *Backwards incompatible*: Removed the (#dbref) display from
@ -32,6 +37,7 @@
account (Griatch) account (Griatch)
- [Fix][issue4311]: SSH connection caused a traceback in protocol (Griatch) - [Fix][issue4311]: SSH connection caused a traceback in protocol (Griatch)
- Fix: Resolve a bug when loading on-demand-handler data from database (Griatch) - Fix: Resolve a bug when loading on-demand-handler data from database (Griatch)
- Security: Potentially O(n2) regex exploit in rpsystem regex (Griatch)
- Doc fixes (iLPdev, Griatch, CloudKeeper) - Doc fixes (iLPdev, Griatch, CloudKeeper)
[pull3420]: https://github.com/evennia/evennia/pull/3420 [pull3420]: https://github.com/evennia/evennia/pull/3420

View file

@ -257,7 +257,7 @@ MXP_OUTGOING_ONLY = True
# time depends very much on your game so some experimentation may # time depends very much on your game so some experimentation may
# be necessary (use @server to see how many objects are in the idmapper # be necessary (use @server to see how many objects are in the idmapper
# cache at any time). Setting this to None disables the cache cap. # cache at any time). Setting this to None disables the cache cap.
IDMAPPER_CACHE_MAXSIZE = 200 # (MB) IDMAPPER_CACHE_MAXSIZE = 400 # (MB)
# This determines how many connections per second the Portal should # This determines how many connections per second the Portal should
# accept, as a DoS countermeasure. If the rate exceeds this number, incoming # accept, as a DoS countermeasure. If the rate exceeds this number, incoming
# connections will be queued to this rate, so none will be lost. # connections will be queued to this rate, so none will be lost.

View file

@ -159,7 +159,8 @@ from evennia.commands.command import Command
from evennia.objects.models import ObjectDB from evennia.objects.models import ObjectDB
from evennia.objects.objects import DefaultCharacter, DefaultObject from evennia.objects.objects import DefaultCharacter, DefaultObject
from evennia.utils import ansi, logger from evennia.utils import ansi, logger
from evennia.utils.utils import iter_to_str, lazy_property, make_iter, variable_from_module from evennia.utils.utils import (iter_to_str, lazy_property, make_iter,
variable_from_module)
_INFLECT = inflect.engine() _INFLECT = inflect.engine()
@ -217,7 +218,7 @@ _RE_CHAREND = re.compile(r"\W+$", _RE_FLAGS)
_RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+") _RE_REF_LANG = re.compile(r"\{+\##([0-9]+)\}+")
# language says in the emote are on the form "..." or langname"..." (no spaces). # language says in the emote are on the form "..." or langname"..." (no spaces).
# this regex returns in groups (langname, say), where langname can be empty. # this regex returns in groups (langname, say), where langname can be empty.
_RE_LANGUAGE = re.compile(r"(?:(\w+))*(\".+?\")") _RE_LANGUAGE = re.compile(r'(\w+)?(".*?")')
# the emote parser works in two steps: # the emote parser works in two steps:

View file

@ -238,7 +238,7 @@ MXP_OUTGOING_ONLY = True
# time depends very much on your game so some experimentation may # time depends very much on your game so some experimentation may
# be necessary (use @server to see how many objects are in the idmapper # be necessary (use @server to see how many objects are in the idmapper
# cache at any time). Setting this to None disables the cache cap. # cache at any time). Setting this to None disables the cache cap.
IDMAPPER_CACHE_MAXSIZE = 200 # (MB) IDMAPPER_CACHE_MAXSIZE = 400 # (MB)
# This determines how many connections per second the Portal should # This determines how many connections per second the Portal should
# accept, as a DoS countermeasure. If the rate exceeds this number, incoming # accept, as a DoS countermeasure. If the rate exceeds this number, incoming
# connections will be queued to this rate, so none will be lost. # connections will be queued to this rate, so none will be lost.