kobako 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/Cargo.lock +1 -1
- data/ext/kobako/Cargo.toml +1 -1
- data/lib/kobako/transport/dispatcher.rb +32 -2
- data/lib/kobako/version.rb +1 -1
- data/release-please-config.json +2 -1
- data/sig/kobako/transport/dispatcher.rbs +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2af9677bcec2d298db05d1259360b9589ac7726d855157dbbfd0be0ca666472
|
|
4
|
+
data.tar.gz: 5ed589a7b179274650d04280d9f84456873ec6fbab46166e85974a3d92d9ab9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59c775f5aacdf0b81a8f00970385974d2e7173b356d9886bd7e173f006a668449eb1672833b222129a227a5f4a3746b92d1fece7b44265eba44963414406b8d2
|
|
7
|
+
data.tar.gz: d902273d0c0df298c41e6be747d692ba8ceec86f564c81cd81347a75bf2a78b2fc35cfd73ccbd44696cabcff01cfdcf76d7260ba99cd2f194a1400cdbe4e88df
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{".":"0.9.
|
|
1
|
+
{".":"0.9.1","wasm/kobako-core":"0.4.0","wasm/kobako":"0.4.0","wasm/kobako-io":"0.4.0","wasm/kobako-regexp":"0.4.0"}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.1](https://github.com/elct9620/kobako/compare/v0.9.0...v0.9.1) (2026-06-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **transport:** block ambient reflection in guest dispatch (GHSA-7pwq-q9jf-539h) ([dd08166](https://github.com/elct9620/kobako/commit/dd081665f368f7ba54e476c3ad045ee1aa8ed703))
|
|
9
|
+
|
|
3
10
|
## [0.9.0](https://github.com/elct9620/kobako/compare/v0.8.0...v0.9.0) (2026-06-10)
|
|
4
11
|
|
|
5
12
|
|
data/Cargo.lock
CHANGED
data/ext/kobako/Cargo.toml
CHANGED
|
@@ -42,6 +42,17 @@ module Kobako
|
|
|
42
42
|
# ({docs/behavior.md E-12}[link:../../../docs/behavior.md]).
|
|
43
43
|
class UndefinedTargetError < StandardError; end
|
|
44
44
|
|
|
45
|
+
# Modules whose instance methods are ambient Ruby reflection /
|
|
46
|
+
# metaprogramming surface (+send+, +public_send+, +instance_eval+,
|
|
47
|
+
# +method+, +tap+, +instance_variable_get+, ...) rather than Service
|
|
48
|
+
# behaviour. A guest-supplied method name resolving to one of these is
|
|
49
|
+
# rejected: the security contract is that only methods the bound object
|
|
50
|
+
# itself defines are reachable, and +public_send(:send, ...)+ would
|
|
51
|
+
# otherwise let a guest pivot through +send+ into the private
|
|
52
|
+
# +Kernel#eval+ / +#system+ surface (host RCE).
|
|
53
|
+
META_OWNERS = [BasicObject, Kernel, Object, Module, Class].freeze
|
|
54
|
+
private_constant :META_OWNERS
|
|
55
|
+
|
|
45
56
|
# Dispatch a single transport request and return the encoded
|
|
46
57
|
# Response bytes ({docs/behavior.md B-12}[link:../../../docs/behavior.md]).
|
|
47
58
|
# Invoked from the +Runtime#on_dispatch+ Proc that
|
|
@@ -109,14 +120,33 @@ module Kobako
|
|
|
109
120
|
# so the same call site handles both cases without an explicit
|
|
110
121
|
# conditional.
|
|
111
122
|
def invoke(target, method, args, kwargs, yielder = nil)
|
|
123
|
+
name = method.to_sym
|
|
124
|
+
reject_meta_method!(target, name)
|
|
112
125
|
block = yielder&.to_proc
|
|
113
126
|
if kwargs.empty?
|
|
114
|
-
target.public_send(
|
|
127
|
+
target.public_send(name, *args, &block)
|
|
115
128
|
else
|
|
116
|
-
target.public_send(
|
|
129
|
+
target.public_send(name, *args, **kwargs, &block)
|
|
117
130
|
end
|
|
118
131
|
end
|
|
119
132
|
|
|
133
|
+
# Guard the +public_send+ below against ambient reflection methods
|
|
134
|
+
# (see {META_OWNERS}). A concretely-defined public method whose owner
|
|
135
|
+
# is a meta module is rejected; a name with no concrete public method
|
|
136
|
+
# is allowed only when the target opts into it via +respond_to?+
|
|
137
|
+
# (dynamic +method_missing+ Services), since the dangerous meta methods
|
|
138
|
+
# are all concretely defined and therefore never reach that branch.
|
|
139
|
+
def reject_meta_method!(target, name)
|
|
140
|
+
owner = target.public_method(name).owner
|
|
141
|
+
return unless META_OWNERS.include?(owner)
|
|
142
|
+
|
|
143
|
+
raise UndefinedTargetError, "method #{name.inspect} is not a Service method"
|
|
144
|
+
rescue NameError
|
|
145
|
+
return if target.respond_to?(name)
|
|
146
|
+
|
|
147
|
+
raise UndefinedTargetError, "no public method #{name.inspect} on target"
|
|
148
|
+
end
|
|
149
|
+
|
|
120
150
|
# {docs/behavior.md B-16}[link:../../../docs/behavior.md] — A Kobako::Handle arriving as a positional or keyword
|
|
121
151
|
# argument identifies a host-side object previously allocated by a prior
|
|
122
152
|
# transport call's Handle wrap (B-14). Resolve it back to the Ruby object before
|
data/lib/kobako/version.rb
CHANGED
data/release-please-config.json
CHANGED
|
@@ -6,6 +6,8 @@ module Kobako
|
|
|
6
6
|
|
|
7
7
|
BREAK_THROW: Symbol
|
|
8
8
|
|
|
9
|
+
META_OWNERS: Array[Module]
|
|
10
|
+
|
|
9
11
|
def self?.dispatch: (String request_bytes, Kobako::Catalog::Namespaces namespaces, Kobako::Catalog::Handles handler, ^(String) -> String yield_to_guest) -> String
|
|
10
12
|
|
|
11
13
|
def self?.resolve_call_args: (Kobako::Transport::Request request, Kobako::Catalog::Handles handler) -> [Array[untyped], Hash[Symbol, untyped]]
|
|
@@ -14,6 +16,8 @@ module Kobako
|
|
|
14
16
|
|
|
15
17
|
def self?.invoke: (untyped target, String method, Array[untyped] args, Hash[Symbol, untyped] kwargs, ?Kobako::Transport::Yielder? yielder) -> untyped
|
|
16
18
|
|
|
19
|
+
def self?.reject_meta_method!: (untyped target, Symbol name) -> void
|
|
20
|
+
|
|
17
21
|
def self?.resolve_arg: (untyped value, Kobako::Catalog::Handles handler) -> untyped
|
|
18
22
|
|
|
19
23
|
def self?.resolve_target: (String | Kobako::Handle target, Kobako::Catalog::Namespaces namespaces, Kobako::Catalog::Handles handler) -> untyped
|