mirror of
https://github.com/matrix-construct/construct
synced 2025-03-13 21:10:32 +01:00
ircd:Ⓜ️:vm: Add event origin for internal room paranoid check in eval.
This commit is contained in:
parent
49ce16d74b
commit
5d9ec170f8
1 changed files with 12 additions and 1 deletions
|
@ -881,9 +881,14 @@ ircd::m::vm::execute_pdu(eval &eval,
|
|||
at<"type"_>(event)
|
||||
};
|
||||
|
||||
const bool internal
|
||||
{
|
||||
m::internal(room_id)
|
||||
};
|
||||
|
||||
const bool authenticate
|
||||
{
|
||||
opts.auth && !internal(room_id)
|
||||
opts.auth && !internal
|
||||
};
|
||||
|
||||
// The conform hook runs static checks on an event's formatting and
|
||||
|
@ -894,6 +899,12 @@ ircd::m::vm::execute_pdu(eval &eval,
|
|||
call_hook(conform_hook, eval, event, eval);
|
||||
}
|
||||
|
||||
if(unlikely(internal && !my(event)))
|
||||
throw error
|
||||
{
|
||||
fault::GENERAL, "Internal room event denied from external source."
|
||||
};
|
||||
|
||||
if(unlikely(eval::count(event_id) > 1))
|
||||
throw error
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue