Commit graph

652 commits

Author SHA1 Message Date
Peter Taoussanis
c9d2aae85d Bump minimum Encore version -> latest
Not strictly necessary, but probably not a bad idea to encourage folks
to at least get on v3.x since it does contain relevant performance
improvements.

Shouldn't be any reason preventing folks from using the latest version
of Encore unless they're on a really ancient version of Clojure
(< v1.7 released 2015).
2022-06-23 12:34:48 +02:00
Peter Taoussanis
f10722ac3f Bump deps 2022-06-23 12:29:04 +02:00
Peter Taoussanis
62d4deca54 v3.1.2 2022-06-23 2022-06-23 12:28:22 +02:00
Peter Taoussanis
8909a32bdd [#89 #150] [Fix] Boxed Booleans incorrectly freezing to primitive true (@RolT)
Before this commit:
  (freeze true)                  => froze as primitive `true`
  (freeze false)                 => froze as primitive `false`
  (freeze (Boolean. <anything>)) => froze as primitive `true`

After this commit:
  Boxed Booleans are first unboxed to correct primitive value before freezing

This was a long-standing bug, though thankfully unlikely to have affected most
users since boxed Booleans are rarely used in Clojure. Cases with Java interop
are the most likely to have been affected.

A big thanks to Roland Thiolliere (@RolT) for this fix!
2022-06-23 12:24:40 +02:00
Peter Taoussanis
ba8827708e v3.1.1 2020-11-18 2020-11-18 12:08:48 +01:00
Peter Taoussanis
ef8a9b659d Bump deps 2020-11-18 11:54:24 +01:00
Daniel Mason
8429814a65 [#138] Fix typo bug: medium keyword+symbol length fields should be a Short (@danmason)
Looks like a typo snuck in here and wasn't caught by tests since they didn't include
names >127 characters.
2020-11-18 11:51:34 +01:00
Peter Taoussanis
b61bf594a1 Update README to incl. java.time.Period example 2020-11-06 15:59:56 +01:00
Peter Taoussanis
79e78f1e51 v3.1.0 2020-11-06 2020-11-06 15:50:58 +01:00
Peter Taoussanis
97dd98ed43 Add default Serializable support for many standard java.time classes
Further additions welcome
2020-11-06 15:50:58 +01:00
Peter Taoussanis
043b37211d Add native support for java.time.Period 2020-11-06 15:50:58 +01:00
Peter Taoussanis
6dd21e0e15 Add native support for java.time.Duration 2020-11-06 15:50:58 +01:00
Peter Taoussanis
5097e16727 Bump Snappy test dependency (1.1.7.7 -> 1.1.8) 2020-11-06 15:50:53 +01:00
Peter Taoussanis
53a3c97edf Add (deprecated) swap-serializable-whitelist! for backwards compatibility 2020-11-06 15:34:18 +01:00
Peter Taoussanis
93755570a5 [#137] Add thaw-from-resource 2020-11-06 15:34:18 +01:00
Peter Taoussanis
a98b0d8bb1 java.time.Instant support housekeeping 2020-10-24 16:53:02 +02:00
Peter Taoussanis
32e4c13ca2 v3.1.0-RC1 2020-10-24 2020-10-24 14:38:10 +02:00
Peter Taoussanis
2203a4800c [#135 #128] Add support for java.time.Instant (@cnuernber) 2020-10-24 14:38:02 +02:00
Peter Taoussanis
5502e0d479 Misc housekeeping 2020-10-24 14:10:32 +02:00
Peter Taoussanis
d910654814 Bump deps 2020-10-24 12:25:29 +02:00
Peter Taoussanis
c8df9b2f30 Update README template 2020-10-04 10:16:17 +02:00
Peter Taoussanis
d0ad2884a7 Update CHANGELOG 2020-09-20 13:37:09 +02:00
Peter Taoussanis
21a2cf4393 v3.0.0 2020-09-20 2020-09-20 13:04:17 +02:00
Peter Taoussanis
6b855b22bb Add Github build.yml 2020-09-20 12:05:37 +02:00
Peter Taoussanis
9600e8c4cd [#131] Serializable: incl. back-compatibility with *serializable-whitelist* 2020-09-15 09:36:09 +02:00
Peter Taoussanis
4b03616395 [#131] Serializable: make check failure error message clearer 2020-09-15 09:19:10 +02:00
Peter Taoussanis
23400e7735 Serializable: simplify amortized cost impl. 2020-09-12 16:59:56 +02:00
Peter Taoussanis
d77381378d v3.0.0-RC3 2020-09-12 2020-09-12 12:26:58 +02:00
Peter Taoussanis
77203271a0 This should be public :-) 2020-09-12 12:26:18 +02:00
Peter Taoussanis
e3c1d478d1 v3.0.0-RC2 2020-09-12 12:16:55 +02:00
Peter Taoussanis
478160ed85 Serializable: add allow-and-record-any-serializable-class-unsafe
A convenience for folks upgrading from older versions of Nippy
still vulnerable to #130.
2020-09-12 12:16:55 +02:00
Peter Taoussanis
d7229f8665 Serializable: docstring improvements 2020-09-12 11:55:29 +02:00
Peter Taoussanis
ac0df2b307 Return private write-str-<size> fns 2020-09-12 11:55:29 +02:00
Peter Taoussanis
46624ae4ba Bump deps 2020-09-12 11:55:29 +02:00
Peter Taoussanis
0cc896f9b1 Add FUNDING.yml 2020-09-12 11:55:29 +02:00
Peter Taoussanis
6f70f6d7f7 Update README template 2020-09-12 11:55:29 +02:00
Peter Taoussanis
f91292c969 v3.0.0-RC1 2020-09-11 12:37:54 +02:00
Peter Taoussanis
9cac0afb98 Misc housekeeping 2020-09-11 10:43:28 +02:00
Peter Taoussanis
c4251fb39f [BREAKING][#130] Serializable: split *serializable-whitelist* into separate freeze/thaw lists
Removed 2x vars:
  -     *serializable-whitelist*
  - swap-serializable-whitelist!

Added 4x vars:
  -     *freeze-serializable-allowlist*
  -       *thaw-serializable-allowlist*
  - swap-freeze-serializable-allowlist!
  -   swap-thaw-serializable-allowlist!

Deprecated 2x JVM properties:
  - taoensso.nippy.serializable-whitelist-base
  - taoensso.nippy.serializable-whitelist-add

Deprecated 2x ENV vars:
  - TAOENSSO_NIPPY_SERIALIZABLE_WHITELIST_BASE
  - TAOENSSO_NIPPY_SERIALIZABLE_WHITELIST_ADD

API is otherwise identical.

MOTIVATION

  An API break is unfortunate- but the break here is small, and the
  benefit significant.

  By separating the freeze/thaw lists, it becomes possible to safely
  allow *any* classes to be frozen - and so effectively make the
  allowlist a purely thaw-time concern in the common case.

  This has several advantages including:

    - No risk of Nippy calls unexpectedly throwing where they didn't
      before.

    - The ability to adjust or bypass the thaw allowlist *after*
      seeing which class objects have been quarantined.

  In general: this change eases migration to RCE-safe Nippy from
  RCE-vulnerable versions. This is especially useful in cases where
  Nippy is being used as an ~implementation detail for another
  library/application/service.
2020-09-11 10:38:58 +02:00
Peter Taoussanis
8244f575a6 Serializable: refactor tests 2020-09-10 22:56:45 +02:00
Peter Taoussanis
057e2f1cd1 Serializable: add read-quarantined-serializable-object-unsafe! util 2020-09-10 22:56:45 +02:00
Peter Taoussanis
db2c22eed8 Serializable: NB freeze default is now always to ALLOW ALL
We have 2 options:

  A: Default to Serializable whitelist checks on both freeze and thaw
  B: Default to Serializable whitelist checks only on thaw

Before this commit, Nippy was taking option A.
As of  this commit, Nippy is  taking option B.

Both are equally safe re: the risk of Remote Code Execution in #130:

  - Freezing a        malicious payload  is  *not* a security risk
  - Thawing  a frozen malicious payload *is*       a security risk.

But option B has the benefit of not throwing exceptions by default
against a whitelist that has not [yet] been properly configured.

This is especially helpful for other libraries or applications that
may be using Nippy as an underlying dependency.

Behaviour under our two options against a whitelist that has not
[yet] been properly configured:

  A: Throw exception on freeze
  B: Freeze successfully, and thaw successully as
     {:nippy/unthawable {:class-name <> :content <quarantined-ba> :cause :quarantined}}

I think this is probably less of a nuissance, and so a better default.
2020-09-10 22:56:45 +02:00
Peter Taoussanis
db71943a5b [#122] Option to disable freezing and/or thawing of metadata 2020-09-10 22:56:45 +02:00
Peter Taoussanis
8f71638a19 Officially allow binding config via calls to freeze, thaw, etc. 2020-09-10 22:56:45 +02:00
Peter Taoussanis
25706d09d5 [BREAKING] Standardize :nippy/_ response forms 2020-09-10 22:53:45 +02:00
Peter Taoussanis
b4b5450d97 Serializable: mod whitelist check impl. to match Tufte 2020-09-10 22:53:45 +02:00
Peter Taoussanis
252d898ff1 Misc housekeeping 2020-09-10 22:53:45 +02:00
Peter Taoussanis
ee12b40dde Add auto-size read-str 2020-09-10 22:53:45 +02:00
Peter Taoussanis
421d45b3c3 Bump Encore dep (v3.0.0) 2020-09-10 22:53:43 +02:00
Peter Taoussanis
7464f1e044 [BREAKING] Bump minimum Clojure 1.5->1.7 2020-09-10 12:37:21 +02:00