Commit Graph

11 Commits

Author SHA1 Message Date
Gary Russell
d10f537283 Dissallow traversal entry even for byte[]
The previous change prevents the transformer from writing a file outside of
the working directory.

However it still produced an entry for an errant file when producing just contents,
and not writing to the file system. However, the errant path would be added to the
message and might be used by subsequent components to write to the file system.

This situation is present in the `UnZip2FileTests`.

While this vulnerability is not directly exposed by the framework, user applications
could be affected by it.
2018-05-10 10:07:57 -04:00
Artem Bilan
8d1752cb98 Remove unnecessary check for the ..
The check for `startsWith(workDirectory)` in the target file
canonical path is fully enough
2018-05-04 15:06:18 -04:00
Artem Bilan
a5573eb232 Disallow traversal entity in zip
When the file name holds path traversal file names it gets
concatenated to the target extraction directory,
the final path ends up outside of the target folder.
2018-05-03 09:43:45 -04:00
Jorge
8c347877d9 ZipTransformer: Use FILENAME header if specified
If FILENAME is present at headers we must use this value as the name 
of zip file without conversion
2017-10-23 17:32:57 -04:00
Artem Bilan
deeeccc40b GH-160: Optimize UnZipResultSplitter
Fixes spring-projects/spring-integration-extensions#160

* Upgrade to `zt-zip-1.11`
* Polish README a bit
2017-06-21 16:46:22 -04:00
Artem Bilan
6f1b2babf6 Upgrade to Gradle 4.0 and SI-4.3.10 2017-06-21 15:47:16 -04:00
Artem Bilan
9a13e41d96 GH-164: Fix ZipTransformer deleteFile Mode
Fixes GH-164 (https://github.com/spring-projects/spring-integration-extensions/issues/164)

* Move `deleteFile` logic to the end of of `ZipTransformer#doZipTransform()`
* Add `deleteFile = true` for the `ZipTransformerTests`
* Add `<request-handler-advice-chain>` to the transformers XSD definitions
* Upgrade to Gradle 3.0
* Upgrade dependencies

Move delete logic before reply message creation
2016-09-21 16:54:27 -04:00
englishman
8dcca5b676 INTEXT-219 Remain request headers after splitting
JIRA: https://jira.spring.io/browse/INTEXT-219

INTEXT-219: add unit test

INTEXT-219: fix missed headers

INTEXT-219: update file headers

INTEXT-219: simplify context

INTEXT-219: add test for preserving service header values

INTEXT-219: rename auxiliary methods

Code style polishing
2016-04-06 10:34:41 -04:00
Artem Bilan
cd37ecae9a ZIP: More Polishing 2016-01-08 12:15:31 -05:00
Artem Bilan
0a5fedcd7a Zip: Some deep cleanup and polishing
* Upgrade to Gradle-2.5, SI-4.2.4
* Remove redundant dependencies
* Add `slf4j-log4j12` to avoid log noise during testing
* Add `settings.gradle` to allow Artifactory Release Management
* Move XSD stuff to the proper place - `org\springframework\integration\zip\config`
* Get rid of manual `enum` transformation in the `Parser`:
  - we can't do that there because `property-placeholder` and SpEL are processed later
  - no reason to do that at all - `enum`s are properly converted by the SF during bean population phase
* Fix `UnZipTransformer` to `delete()` file in the `finally` block after closing the `InputStream` on file
2016-01-07 21:44:23 -05:00
Gunnar Hillert
416cc39da4 INTEXT-40 Add ZIP Transformer
* Add zip-transformer
* Add unzip-transformer
* Add UnZipResultSplitter
* Add sample

For reference see: https://jira.springsource.org/browse/INTEXT-40
2015-06-15 17:36:44 -04:00