-
Notifications
You must be signed in to change notification settings - Fork 128
fix[PPP-5720]: remove instances of unsafe deserialization by readObject #430
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
Conversation
c57e378 to
5875d3f
Compare
|
From running a test workflow without these changes, I can see that 19 of the 24 failed tests are failing regardless of the changes in this PR. The ones that are currently failing due to this PR are the following:
(Which makes sense because they relate to the addition of the Currently working on addressing these. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6ed11ac to
6a3b74d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
core/src/main/java/pt/webdetails/cda/dataaccess/DenormalizedMdxDataAccess.java
Outdated
Show resolved
Hide resolved
core/src/main/java/pt/webdetails/cda/dataaccess/MdxDataAccess.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…InputStream + change more instances of readObject to readUTF
… SonarQube suggestions
…e some more instances of readObject to readUTF + some more SonarQube suggestions
Analysis Details0 IssuesCoverage and DuplicationsProject ID: pentaho:cda-plugin |
Note:Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system. |
✅ Build finished in 16m 11sBuild command: mvn clean verify -B -e -Daudit -Djs.no.sandbox👌 All tests passed! Tests run: 240, Failures: 0, Skipped: 0 Test Results ℹ️ This is an automatic message |







My main changes involve 3 different fixes for these insecure uses of
readObject:when the object was a String, I replaced
writeObjectandreadObjectwithwriteUTFandreadUTF;when the object was a custom type, I added it to an ObjectInputFilter, which is passed into the
ObjectInputStream, to only allow those types:ObjectInputStreamdoes some stream header reading on its constructor, and you can only set anObjectInputFilterwhen the stream has not read anything, so I had to do it via this custom class, as the filter could not be set after class instantiation;for
extraCacheKeyI could not add it to the filter as is, because the object was aSerializable, and if I allow theObjectInputStreamto acceptSerializableobjects, the danger of injection attacks still remains. However I saw thatextraCacheKeywas just aCacheKeyobject that was being unnecessarily converted (or "extended") to its parent typeSerializable, so I just made it "remain" as aCacheKeythrough the whole process and then filtered that custom type, similarly to the ones on the above step.I also addressed (in a separate commit) some of the SonarQube changes suggested for the files I altered (and some other files that I had altered but ended up not altering), but I wasn't super thorough and basically only did the changes which I believed would not cause problems elsewhere.