Commit 65faa45
fix: reject mismatched skill_id between payload and bus context (OVOS-INTENT-4 §3.2)
handle_register_template, handle_register_entity, handle_deregister_intent,
handle_deregister_entity and handle_deregister_skill trusted message.data's
skill_id unconditionally, letting any producer claim ownership of another
skill's intents/entities by forging the payload field. message.context is
attached by the bus client itself and cannot be forged by a message
producer, so it is the authoritative attribution per OVOS-INTENT-4 §3.2.
Add module-level _skill_id_from_context(message, handler), mirroring
ovos_adapt/opm.py:73, and use it in all five handlers: when context carries
a skill_id that disagrees with the payload, reject the call (return None,
LOG.warning naming both values and the topic) instead of acting on either
side. When context carries no skill_id (legacy, pre-spec producers),
today's payload-trusting behaviour is unchanged. The legacy
handle_detach_intent, which the bus-client twins from
ovos.intent.deregister while carrying the original context, gets the same
prefix check against its already-namespaced intent_name.
Fail-before: both new regression tests (mismatched register.template
indexing nothing, ovos.skill.deregister with data.skill_id=victim /
context.skill_id=attacker leaving victim's intents matchable) failed
against the unfixed source and pass after. Full suite: 90 passed, 2 skipped
(pre-existing), 0 failed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent e063f0c commit 65faa45
2 files changed
Lines changed: 89 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
286 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
287 | 304 | | |
288 | 305 | | |
289 | 306 | | |
| |||
450 | 467 | | |
451 | 468 | | |
452 | 469 | | |
453 | | - | |
| 470 | + | |
454 | 471 | | |
455 | 472 | | |
456 | 473 | | |
| |||
494 | 511 | | |
495 | 512 | | |
496 | 513 | | |
497 | | - | |
| 514 | + | |
498 | 515 | | |
499 | 516 | | |
500 | 517 | | |
| |||
535 | 552 | | |
536 | 553 | | |
537 | 554 | | |
538 | | - | |
| 555 | + | |
539 | 556 | | |
540 | 557 | | |
541 | 558 | | |
| |||
544 | 561 | | |
545 | 562 | | |
546 | 563 | | |
547 | | - | |
| 564 | + | |
548 | 565 | | |
549 | 566 | | |
550 | 567 | | |
| |||
554 | 571 | | |
555 | 572 | | |
556 | 573 | | |
557 | | - | |
| 574 | + | |
558 | 575 | | |
559 | 576 | | |
560 | 577 | | |
| |||
731 | 748 | | |
732 | 749 | | |
733 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
734 | 783 | | |
735 | 784 | | |
736 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
220 | 254 | | |
221 | 255 | | |
222 | 256 | | |
| |||
0 commit comments