Up to 0.12.0, Kulyrax's file-backed key-value, document and graph stores named each file after an entity id taken from the event payload, without encoding it. Anyone who can put an event on a source Kulyrax reads could write, and on delete remove, .json files outside the store root, or make two entities share one file and one guard lane. Fixed in 0.12.1. Upgrading can require rebuilding a store; see the 0.12.1 release notes.
Kulyrax's file-backed key-value, document and graph stores wrote each entity
to a file named after its id, and the id comes from the event payload
(the mapping's key: for key-value and graph nodes, id: for documents). Up to 0.12.0 the id was used
as-is: <root>/<namespace>/<id>.json, plus a guard file under
<root>/.conduit/.
An id is not a safe file name:
../ (or ..\ on Windows, or an
absolute path) put the value file and its guard file outside the store
root. A delete event for that id removed the file at that path. The file's
content is the projected value, built from payload fields the mapping
selects.K and k are one file. The two entities shared one guard lane.
After a restart, an older event for one could be applied over a newer
state. Idempotency is the guarantee the guard lanes exist for.CON, NUL, …) and ids with a trailing . failed every event for
that entity, or were written somewhere other than where they were read.
Related, also fixed in 0.12.1:wal or lock put guard files in the
directories of the store's batch log and lock, breaking crash recovery and
locking for that store. Mapping names were not validated, so ../x also
worked as a namespace, collection, label or edge type.<event_id>.<position>.json with the source
position unencoded. Over the gRPC ingest endpoint the producer chooses the
position, so ../../x placed the dead-letter file outside dlq_dir.: could meet another namespace's keys; Neo4j labels
with a backtick broke out of their quoting (configuration-controlled);
Elasticsearch document ids . and .. addressed another endpoint. Event
values were always bound parameters in SQL and Neo4j, and MongoDB was not
affected.
Who can exploit it: anyone who can get an event onto a source Kulyrax reads,
for example a producer allowed on the gRPC ingest endpoint, a writer to a
watched event directory, or a writer to a Postgres outbox table. It applies
only to deployments using the file-backed key-value, document or graph stores
(adapter type: keyvalue, file or graph) or a dlq_dir with a source
whose positions the producer controls.kulyrax.yaml:
version: 1
routing:
file: routing.yaml
adapters:
- type: keyvalue
id: kv
priority: 10
config:
root: ./store
sources:
- type: directory
id: events
path: ./events
state_dir: ./staterouting.yaml:
UserUpdated: [kv]mappings/keyvalue/user_updated.yaml (plus empty mappings/sql/ and
mappings/document/ directories):
event: UserUpdated
namespace: users
version: 1
key: payload.id
value:
name: payload.nameevents/000001.ndjson (one line):
{"event_id":"e1","event_type":"UserUpdated","metadata":{},"payload":"{\"id\":\"../../outside\",\"name\":\"x\"}","sequence":1,"version":1}Run kulyrax run --config kulyrax.yaml --mappings mappings --once in that
directory.
./outside.json, outside the store root ./store. The guard
escapes too, to ./store/outside.guard.json../store/users/^2e.^2f..^2foutside.json and
./store/.conduit/kv/users/^2e.^2f..^2foutside.guard.json.
Case folding (Windows, or macOS by default): project {"id": "K"} at
sequence 5 and {"id": "k"} at sequence 1, restart, then project {"id": "K"}
at sequence 3. On 0.12.0 the last event is applied (Updated) over the newer
state. On 0.12.1 it is skipped as stale..json files removed, anywhere the Kulyrax process can write, outside the
configured store. Projected state silently overwritten by older events on
case-insensitive file systems.wal or lock breaks recovery and locking for the
store.Fuente: NVD
Evaluación gratuita de vulnerabilidades
Evalúa tus prácticas de seguridad en la nube en 9 dominios de seguridad para evaluar tu nivel de riesgo e identificar brechas en tus defensas.
Obtén una demostración personalizada
"La mejor experiencia de usuario que he visto en mi vida, proporciona una visibilidad completa de las cargas de trabajo en la nube."
"Wiz proporciona un panel único para ver lo que ocurre en nuestros entornos en la nube."
"Sabemos que si Wiz identifica algo como crítico, en realidad lo es."