Podatność w komponencie AWS2-SQS frameworka Apache Camel umożliwia nieuprzywilejowanemu nadawcy wiadomości SQS wstrzyknięcie wewnętrznych nagłówków kontrolnych Camel do przetwarzanej trasy. Może to prowadzić do nieautoryzowanej modyfikacji zachowania producentów downstream, np. przekierowania żądań HTTP, zmiany nazw plików lub nadpisania zapytań SQL.
▸ Pokaż oryginał (EN)
Improper Input Validation vulnerability in Apache Camel AWS2-SQS Component. The camel-aws2-sqs component map inbound message attributes into the Camel Exchange through a component-specific HeaderFilterStrategy. Sqs2HeaderFilterStrategy configured only an outbound filter (setOutFilterPattern, which blocks Camel*, breadcrumbId and org.apache.camel.* headers being written to the broker) but did not configure an inbound filter. As a result, when Sqs2Consumer copies each SQS MessageAttribute into the Exchange via HeaderFilterStrategy.applyFilterToExternalHeaders, DefaultHeaderFilterStrategy applied no inbound rule and treated every header name as not filtered - including Camel-internal control headers such as CamelHttpUri, CamelFileName or CamelSqlQuery - copying them unmodified onto the Camel message. Any principal able to send messages to the consumed SQS queue (for example a cross-account sender or a lower-privileged in-account component holding sqs:SendMessage) could therefore set arbitrary Camel control headers that influence the behaviour of downstream producers in the route (for example redirecting an HTTP producer, changing a file name, or overriding a query); the injected headers also persist across internal direct, seda and vm hops. The concrete downstream impact depends on which producers the route uses. This issue affects Apache Camel: from 4.0.0 before 4.14.8, from 4.15.0 before 4.18.3, from 4.19.0 before 4.21.0. Users are recommended to upgrade to version 4.21.0, which fixes the issue. If users are on the 4.14.x LTS releases stream, then they are suggested to upgrade to 4.14.8. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.3. The fix adds an inbound HeaderFilterStrategy rule to Sqs2HeaderFilterStrategy that filters the Camel header namespace case-insensitively on inbound mapping, so sender-supplied Camel* / camel* headers are no longer copied into the Exchange. For deployments that cannot upgrade immediately, strip the Camel control headers from inbound messages before they reach any downstream producer (for example removeHeaders('Camel*') and removeHeaders('camel*') at the start of the route), and restrict who may send to the consumed SQS queue by applying least-privilege sqs:SendMessage permissions on the queue resource policy.
Komponent Sqs2HeaderFilterStrategy w Apache Camel był skonfigurowany wyłącznie z filtrem wychodzącym (blokującym nagłówki Camel* oraz breadcrumbId przy zapisie do brokera), natomiast nie posiadał filtra przychodzącego. Gdy Sqs2Consumer kopiował atrybuty wiadomości SQS do obiektu Camel Exchange za pomocą metody applyFilterToExternalHeaders, DefaultHeaderFilterStrategy nie stosował żadnej reguły dla ruchu przychodzącego i traktował każdy nagłówek jako dopuszczalny — w tym nagłówki wewnętrzne Camel, takie jak CamelHttpUri, CamelFileName czy CamelSqlQuery. Dowolny podmiot posiadający uprawnienie sqs:SendMessage do kolejki (np. nadawca z innego konta AWS lub mniej uprzywilejowany komponent w tym samym koncie) mógł tym samym umieszczać w wiadomościach SQS nagłówki kontrolne, które po skopiowaniu do Exchange wpływały na działanie producentów w trasie. Wstrzyknięte nagłówki propagowały się ponadto przez wewnętrzne kanały direct, seda i vm.
Atakujący mogą manipulować zachowaniem producentów downstream w trasie Camel — m.in. przekierowywać połączenia HTTP, modyfikować nazwy zapisywanych plików lub nadpisywać zapytania do baz danych — co może skutkować nieautoryzowanym ujawnieniem, modyfikacją lub zniszczeniem danych, a konkretny zakres szkód zależy od konfiguracji trasy.
Należy zaktualizować Apache Camel do wersji 4.21.0 (zalecana), 4.14.8 (gałąź LTS 4.14.x) lub 4.18.3 (gałąź 4.18.x). Poprawka dodaje regułę filtrowania przychodzącego w Sqs2HeaderFilterStrategy, która odrzuca nagłówki z przestrzeni nazw Camel*/camel* niezależnie od wielkości liter. W przypadku braku możliwości natychmiastowej aktualizacji należy: (1) jawnie usunąć nagłówki kontrolne na początku trasy za pomocą removeHeaders('Camel*') i removeHeaders('camel*'), (2) ograniczyć uprawnienie sqs:SendMessage do kolejki zgodnie z zasadą najmniejszych uprawnień w polityce zasobów SQS.
Apache Camel w wersjach od 4.0.0 przed 4.14.8, od 4.15.0 przed 4.18.3 oraz od 4.19.0 przed 4.21.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HApache Camel
APPApache4.0.0 – 4.14.8 (bez)4.15.0 – 4.18.3 (bez)4.19.0 – 4.21.0 (bez)
Powiązane podatności
Improper input validation vulnerability in Apache Camel Undertow component. This issue affects Apache Camel...
Improper input validation vulnerability in Apache Camel Atmosphere Websocket component. This issue affects ...
Relative path traversal vulnerability in Apache Camel Azure Storage Blob component. This issue affects Apac...
Apache Camel Docling — argument injection i path traversal w CLI
Apache Camel Cometd: wstrzykiwanie nagłówków kontrolnych przez brak walidacji