You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-to-4x/migrating-tika-server-4x.adoc
+61-2Lines changed: 61 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,31 @@ for error text should check `tk:exception:container-exception` (full-object
135
135
endpoints) or the `422` body (`/meta/\{field}`, populated only when
136
136
`returnStackTrace=true`).
137
137
138
+
Two changes to the returned metadata come with this, neither of which produces an
139
+
error:
140
+
141
+
* **`/meta` no longer returns a `language` field.** Language detection previously ran
142
+
inline on this endpoint via a dedicated content handler that buffered text solely to
143
+
detect the language, which meant holding the document text twice to populate one
144
+
field. That handler was removed. `/meta` deliberately parses with the `ignore`
145
+
content handler, so there is no text for a language detector to work from.
146
+
+
147
+
**Migration:** configure a language-detection metadata filter
148
+
(`charsoup-metadata-filter`, `optimaize`, or `opennlp`) and use `/rmeta` or
149
+
`/tika/json`, which capture content. The detected value arrives as
150
+
`tk:detected-language`, with `tk:detected-language-confidence`. Note that these
151
+
filters read `tk:content`, so they are no-ops on `/meta` and on any endpoint
152
+
configured with the `ignore` handler.
153
+
154
+
* **`/meta` now sets `tk:exception:embedded-depth-limit-reached` on any document
155
+
with embedded content.** `/meta` suppresses embedded parsing by setting an embedded
156
+
depth limit of `0`, and reaching a limit is recorded. The previous implementation
157
+
suppressed embedded documents by a different mechanism that recorded nothing. The
158
+
flag is expected on this endpoint and does not indicate a truncated result.
159
+
+
160
+
**Migration:** clients that alert on the presence of any `tk:exception:*` key should
161
+
exclude this one for `/meta`.
162
+
138
163
=== Accept Header Routing Removed
139
164
140
165
The `/tika` endpoint no longer routes based on `Accept` headers. Use explicit paths instead:
@@ -157,7 +182,24 @@ The following `TikaServerConfig` options have been removed:
157
182
158
183
=== `/pipes` and `/async` Require `allowPipes`; Per-Request Config Requires `allowPerRequestConfig`
159
184
160
-
Previously these endpoints (and per-request parser configuration) were enabled simply by listing endpoints under `server.endpoints`. The capabilities are now split into two default-`false` flags in the `server` section:
185
+
This replaces the `enableUnsecureFeatures` flag that alpha-1 briefly used, and before
186
+
that, enabling these capabilities simply by listing endpoints under `server.endpoints`.
187
+
`enableUnsecureFeatures` no longer exists: a config that still carries it fails to start
188
+
with an "Unrecognized field" error naming the key, rather than silently ignoring it.
189
+
The single flag has been split into two, so that granting batch/fetcher access and
190
+
granting per-request parser configuration are separate decisions:
191
+
192
+
|===
193
+
|Was |Now
194
+
195
+
|`enableUnsecureFeatures: true` (to use `/pipes` or `/async`)
The capabilities are two default-`false` flags in the `server` section:
161
203
162
204
* `allowPipes` gates the `/pipes` and `/async` endpoints, which drive process-isolated batch parsing through your fetchers and emitters. Selecting either without `allowPipes` causes the server to refuse to start with a clear error.
163
205
* `allowPerRequestConfig` gates per-request parser configuration: the `/config` family of endpoints and the multipart `config` part. When off, such requests are rejected with 403.
@@ -189,7 +231,7 @@ All tika-server configurations must now include a `pipes` section and a `file-sy
189
231
"fetchers": {
190
232
"file-system-fetcher": {
191
233
"file-system-fetcher": {
192
-
"allowAbsolutePaths": true
234
+
"basePath": "/path/to/your/input"
193
235
}
194
236
}
195
237
},
@@ -205,6 +247,23 @@ All tika-server configurations must now include a `pipes` section and a `file-sy
205
247
}
206
248
----
207
249
250
+
[IMPORTANT]
251
+
====
252
+
Set `basePath` to a directory that contains only the documents you intend the
253
+
server to read. It is the filesystem sandbox: the fetcher rejects any fetch key
254
+
that resolves outside it, including absolute paths and `../` traversal, and
255
+
re-checks after resolving symlinks.
256
+
257
+
Setting `allowAbsolutePaths` instead of `basePath` turns that sandbox off
258
+
entirely — fetch keys are then used as raw absolute paths, so any caller who can
259
+
reach `/pipes` can read any file the server process can read. The matching
260
+
emitter setting is worse: it grants arbitrary file *write*. `allowAbsolutePaths`
261
+
is not a relaxation of `basePath`; it is what you get when there is no
262
+
`basePath` at all, and it is a no-op when `basePath` is set. Use it only if you
263
+
genuinely intend an unsandboxed fetcher and have restricted access to the server
264
+
by other means.
265
+
====
266
+
208
267
[IMPORTANT]
209
268
====
210
269
`numClients` is not boilerplate to copy unchanged from this example. In 3.x,
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/pipes/plugins/filesystem.adoc
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,16 +81,16 @@ The outer key (`fsf`) is the fetcher ID — referenced by `pipesIterator.fetcher
81
81
|Field |Default |Description
82
82
83
83
|`basePath`
84
-
|_required_
85
-
|Base directory for fetch operations. Fetch keys are resolved relative to this path.
84
+
|_none_
85
+
|Base directory for fetch operations. Fetch keys are resolved relative to this path and must stay inside it. Not technically required, but omitting it disables containment entirely — see `allowAbsolutePaths` below and <<security-notes>>.
86
86
87
87
|`extractFileSystemMetadata`
88
88
|`false`
89
89
|When `true`, attach file size, created, and modified timestamps to the metadata of each fetched document.
90
90
91
91
|`allowAbsolutePaths`
92
92
|`false`
93
-
|When `true`, fetch keys may be absolute paths and `basePath` may be omitted. Use sparingly — see <<security-notes>>.
93
+
|Permission to run *without* a `basePath`. It is not a relaxation of `basePath` — see <<security-notes>>.
94
94
|===
95
95
96
96
[#file-system-emitter]
@@ -253,6 +253,7 @@ Tradeoffs:
253
253
[#security-notes]
254
254
== Security Notes
255
255
256
-
* **`basePath` is a sandbox boundary.** The fetcher and emitter reject fetch/emit keys that resolve outside `basePath`. Do not set `allowAbsolutePaths=true` unless the source of fetch keys is fully trusted — an attacker-controlled fetch key could otherwise read arbitrary files.
257
-
* **Symlinks are followed.** A symlink under `basePath` pointing outside `basePath` may still be readable. If you need strict containment, do not allow symlinks in your input tree.
256
+
* **`basePath` is the sandbox boundary, and it is the only one.** With `basePath` set, the fetcher and emitter reject any key that resolves outside it, including absolute paths and `../` traversal. `allowAbsolutePaths` has no effect in this state.
257
+
* **Without `basePath` there is no containment at all.** The key is used as a raw absolute path, and the containment checks are skipped entirely. `allowAbsolutePaths=true` is how you assert that you intend this; it is a switch between two states, not a dial that loosens `basePath`. For the fetcher this means any file the process can read; for the emitter, any file it can write. Use it only when fetch/emit keys come from a fully trusted source and access to the service is restricted by other means.
258
+
* **Symlink containment differs between fetcher and emitter.** The fetcher re-checks with `toRealPath()`, so a symlink under `basePath` pointing outside it is rejected. The emitter does not: it checks only the normalized path, so a symlink already present under its `basePath` can be written through. Do not rely on symlinks being contained on the emit side.
258
259
* **Output directories are created automatically.** The emitter creates intermediate directories as needed. Make sure the process's umask is appropriate for the data being written.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/security.adoc
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,9 @@ and `allowComponentManagement` — the latter lets clients add, modify, and dele
56
56
and read back stored configs, which can contain secrets — are off by default. Run it only behind
57
57
network controls and, ideally, mutual TLS. See xref:using-tika/grpc/index.adoc[Tika gRPC].
58
58
59
-
For the upgrade from the former `enableUnsecureFeatures` flag, see
60
-
xref:migration-to-4x/migrating-tika-server-4x.adoc[Migrating tika-server to 4.x].
59
+
For the upgrade from the former `enableUnsecureFeatures` flag, which is now split into
60
+
`allowPipes` and `allowPerRequestConfig`, see
61
+
xref:migration-to-4x/migrating-tika-server-4x.adoc#_pipes_and_async_require_allowpipes_per_request_config_requires_allowperrequestconfig[Migrating tika-server to 4.x].
0 commit comments