Skip to content

Commit f712fdc

Browse files
penn5MoveAngel
authored andcommitted
userbot / events : Critical Security Bug Fix (Assigned as DS-SA-35CA)
There's a vulnerability on evaluation module which can cause a Inline Bot to have a remote privilege elevation to any account that running Paperplane prior to this commit. Issues at: RaphielGang/Telegram-Paperplane#222 Change-Id: Ia0a6c2f5122a9df65919dd25626df3afcb47dd13 Signed-off-by: MoveAngel <[email protected]>
1 parent eb32828 commit f712fdc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

userbot/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def register(**args):
2727
groups_only = args.get('groups_only', False)
2828
trigger_on_fwd = args.get('trigger_on_fwd', False)
2929
disable_errors = args.get('disable_errors', False)
30+
insecure = args.get('insecure', False)
3031

3132
if pattern is not None and not pattern.startswith('(?i)'):
3233
args['pattern'] = '(?i)' + pattern
@@ -46,6 +47,9 @@ def register(**args):
4647
if "trigger_on_fwd" in args:
4748
del args['trigger_on_fwd']
4849

50+
if "insecure" in args:
51+
del args['insecure']
52+
4953
if pattern:
5054
if not ignore_unsafe:
5155
args['pattern'] = pattern.replace('^.', unsafe_pattern, 1)
@@ -64,6 +68,10 @@ async def wrapper(check):
6468
await check.respond("`I don't think this is a group.`")
6569
return
6670

71+
if check.via_bot_id and not insecure:
72+
await check.respond("`Inline bots are disabled for security reasons`")
73+
return
74+
6775
try:
6876
await func(check)
6977

0 commit comments

Comments
 (0)