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
Hey,
I'm sorry to insist... I copied this issue from Pact Legacy... Because in my opinion, this one is the most critical "not already fixed" issue in Pact legacy. It's not a nice to have, neither an edge case: it's definitively a security issue. I can easily write a vulnerable contract. (can show an example if requested).
We've actually raised this issue internally before, and the fix is on the roadmap. Thanks for bringing it to the forefront.
Indeed, pact-5 doesn't have it fixed because we're using the exact same library as pact (pact-time), so unfortunately, we have to fix it in the library or alternatively add a runtime check directly in the new compiler.
We've actually raised this issue internally before, and the fix is on the roadmap. Thanks for bringing it to the forefront.
Indeed, pact-5 doesn't have it fixed because we're using the exact same library as pact (pact-time), so unfortunately, we have to fix it in the library or alternatively add a runtime check directly in the new compiler.
IMHO, the fix is relatively easy... It's just a matter of enforcing safe boundaries for dates and deltas, for unrealistic dates... (year 147997)
See my solution I did in Pact (I added some useful comments) . but need to be carefully reviewed and evaluated
Hey,
I'm sorry to insist... I copied this issue from Pact Legacy... Because in my opinion, this one is the most critical "not already fixed" issue in Pact legacy. It's not a nice to have, neither an edge case: it's definitively a security issue. I can easily write a vulnerable contract. (can show an example if requested).
Maybe the release of Pact core is the good timing to fix it.
FYI: I created a "a la Solidty" workaround: (not published and only very quickly tested): https://github.com/CryptoPascal31/pact-util-lib/blob/ac97feca2dcf1176d9bcc55510a2964dd9d663f6/pact/contracts/util-time.pact#L46
But IMHO, it should be definitively been fixed in Haskell. Because having a workarond in Pact is not an acceptable solution.
Issue description
The
add-time
function can overflow and give unexpected results.Steps to reproduce
Some examples:
As you can see in some cases:
Expected Behavior
Either:
add-time
as "unsafe" without prior boundaries check.The text was updated successfully, but these errors were encountered: