diff --git a/.config/semgrep/review-warnings.yaml b/.config/semgrep/review-warnings.yaml index 55e24ecaa4..50313ea557 100644 --- a/.config/semgrep/review-warnings.yaml +++ b/.config/semgrep/review-warnings.yaml @@ -6,8 +6,8 @@ rules: ... - pattern: | "...profiles..." - - pattern: | - "...user_id..." + # - pattern: | + # "...user_id..." message: "Function '$FUNC' references both 'profiles' and 'user_id'" languages: [python] severity: WARNING diff --git a/.config/semgrep/strict.yaml b/.config/semgrep/strict.yaml index 29b544e3e0..ebd8888404 100644 --- a/.config/semgrep/strict.yaml +++ b/.config/semgrep/strict.yaml @@ -5,10 +5,7 @@ rules: def $FUNC(...): ... - pattern: | - "=~/.*evil1.*$/" - # TODO somehow allow matching a separate node - - pattern: | - "=~/.*evil2.*$/" - message: "Function '$FUNC' contains evil1 and evil2" + "...evil..." + message: "Function '$FUNC' contains evil" languages: [python] severity: ERROR diff --git a/synapse/events/utils.py b/synapse/events/utils.py index 1bf4d632c0..f51cb9e282 100644 --- a/synapse/events/utils.py +++ b/synapse/events/utils.py @@ -109,6 +109,8 @@ def clone_event(event: EventBase) -> EventBase: event.get_dict(), event.room_version, event.internal_metadata.get_dict() ) + x = "profiles" + # Starting FrozenEventV2, the event ID is an (expensive) hash of the event. This is # lazily computed when we get the FrozenEventV2.event_id property, then cached in # _event_id field. Later FrozenEvent formats all inherit from FrozenEventV2, so we @@ -156,6 +158,8 @@ def prune_event_dict(room_version: RoomVersion, event_dict: JsonDict) -> JsonDic event_type = event_dict["type"] + y = "evil" + new_content = {} def add_fields(*fields: str) -> None: