New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vault appears to be empty when ciphertext size of one file is invalid #673

Closed
tobihagemann opened this Issue May 6, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@tobihagemann
Copy link
Member

tobihagemann commented May 6, 2018

Reference

https://community.cryptomator.org/t/folder-in-vault-appears-to-be-empty/1601

Steps to Reproduce

  1. Create and unlock vault
  2. Put at least two files into the vault
  3. Lock vault
  4. Navigate to encrypted vault and go to the encrypted root directory (/d/../....)
  5. Open one of the encrypted files and delete its contents (basically, bring it down to 0 bytes)
  6. Unlock vault

Expected Results

I'd expect to see all files in the virtual drive even though one of them has 0 bytes.

Actual Results

I can't see any file in the virtual drive, it appears to be empty.

Notes

  • Up until Cryptomator 1.3.2, you'd see the following exception in the log file: java.lang.IllegalArgumentException: Malformed ciphertext header.
  • Cryptomator 1.4.0-beta1 with FUSE actually shows the files in the virtual drive except the "broken" one. I'm open for suggestions but I think it'd be better to show the file in the virtual drive in any case.

Stacktrace

java.lang.IllegalArgumentException: expected ciphertextSize to be positive, but was -88
  at com.google.common.base.Preconditions.checkArgument(Preconditions.java:196)
  at org.cryptomator.cryptolib.Cryptors.cleartextSize(Cryptors.java:42)
  at org.cryptomator.cryptofs.CryptoBasicFileAttributes.size(CryptoBasicFileAttributes.java:58)
  at org.cryptomator.frontend.webdav.servlet.DavFile.lambda$sizeProperty$0(DavFile.java:134)
  at java.base/java.util.Optional.map(Unknown Source)
  at org.cryptomator.frontend.webdav.servlet.DavFile.sizeProperty(DavFile.java:134)
  at org.cryptomator.frontend.webdav.servlet.DavFile.getProperty(DavFile.java:118)
  at org.apache.jackrabbit.webdav.MultiStatusResponse.<init>(MultiStatusResponse.java:186)
  ...
  at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.execute(AbstractWebdavServlet.java:362)
  at org.cryptomator.frontend.webdav.servlet.WebDavServlet.execute(WebDavServlet.java:108)
  at org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:305)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
  at org.cryptomator.frontend.webdav.servlet.MacChunkedPutCompatibilityFilter.doFilterHttp(MacChunkedPutCompatibilityFilter.java:58)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  at org.cryptomator.frontend.webdav.servlet.AcceptRangeFilter.doFilterHttp(AcceptRangeFilter.java:38)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  at org.cryptomator.frontend.webdav.servlet.MkcolComplianceFilter.doFilterHttp(MkcolComplianceFilter.java:47)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  at org.cryptomator.frontend.webdav.servlet.PostRequestBlockingFilter.doFilterHttp(PostRequestBlockingFilter.java:46)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  at org.cryptomator.frontend.webdav.servlet.UnicodeResourcePathNormalizationFilter.doFilterHttp(UnicodeResourcePathNormalizationFilter.java:70)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  at org.cryptomator.frontend.webdav.servlet.LoggingFilter.doFilterHttp(LoggingFilter.java:44)
  at org.cryptomator.frontend.webdav.servlet.HttpFilter.doFilter(HttpFilter.java:26)
  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
  ...
  at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.base/java.lang.Thread.run(Unknown Source)

Environment

  • Software Version: 1.3.4 / 1.4.0-beta1 with WebDAV
  • Operating System: any
@infeo

This comment has been minimized.

Copy link
Member

infeo commented Sep 17, 2018

Can be closed when the new nio-adapter library versions are included. We plan this step for the 1.4.0 release.

@infeo infeo closed this Sep 17, 2018

@infeo infeo reopened this Sep 17, 2018

@infeo

This comment has been minimized.

Copy link
Member

infeo commented Oct 11, 2018

Fixed with e08c2b7 .

@infeo infeo closed this Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment