exifreader 4.41.3 → 4.41.4
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.
- package/README.md +15 -0
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/exif-reader.d.ts +36 -1
- package/package.json +7 -6
- package/src/xmp-tags.js +14 -6
package/README.md
CHANGED
|
@@ -184,6 +184,13 @@ Where `file` is one of
|
|
|
184
184
|
* URL (browser or Node.js; remember that in a browser context the remote server
|
|
185
185
|
has to set CORS headers that allow for remote loading of the file)
|
|
186
186
|
|
|
187
|
+
**Security:** When the argument is a string, ExifReader treats it as a URL or a
|
|
188
|
+
local file path and will make a network request or read from the file system.
|
|
189
|
+
Never pass an untrusted or user-controlled string to `load()`. Doing so lets an
|
|
190
|
+
attacker make the process fetch arbitrary URLs (server-side request forgery) or
|
|
191
|
+
open arbitrary local files. For untrusted image data, always pass the bytes
|
|
192
|
+
themselves (an `ArrayBuffer`, a `Buffer`, or a browser `File`), never a string.
|
|
193
|
+
|
|
187
194
|
**Tip:** To read metadata from an `HTMLImageElement`, wait for its `load` event
|
|
188
195
|
and call `ExifReader.load(image.src)`. The browser should reuse the cached file.
|
|
189
196
|
|
|
@@ -201,6 +208,14 @@ Where `fileBuffer` is one of
|
|
|
201
208
|
See the [examples site](https://mattiasw.github.io/ExifReader/) for more
|
|
202
209
|
directions on how to use the library.
|
|
203
210
|
|
|
211
|
+
**Security:** Treat all returned metadata as untrusted input. Tag values,
|
|
212
|
+
descriptions, and the raw XMP packet (`xmp._raw` when using `expanded: true`)
|
|
213
|
+
come straight from the image and can contain arbitrary text, including HTML-like
|
|
214
|
+
markup. Never insert them into a page as HTML (for example through `innerHTML`)
|
|
215
|
+
without escaping or sanitizing them first, otherwise a crafted image could lead
|
|
216
|
+
to cross-site scripting. Use `textContent`, your framework's escaping, or a
|
|
217
|
+
sanitizer such as DOMPurify when displaying metadata.
|
|
218
|
+
|
|
204
219
|
#### Grouping
|
|
205
220
|
|
|
206
221
|
By default, Exif, IPTC and XMP tags are grouped together. This means that if
|