GithubHelp home page GithubHelp logo

sonatype-2021-4646 about rust-embed HOT 9 CLOSED

acim avatar acim commented on July 19, 2024
sonatype-2021-4646

from rust-embed.

Comments (9)

AzureMarker avatar AzureMarker commented on July 19, 2024 1

I think the confusion was that 6.2.0 of the main crate did have the bug (according to the changelog), but it was fixed in the 6.2.0 version of the impl crate.

from rust-embed.

acim avatar acim commented on July 19, 2024

[sonatype-2021-4646] CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

rust-embed-impl - Path Traversal

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

from rust-embed.

pyrossh avatar pyrossh commented on July 19, 2024

Hmm I don't know if the typical scenario ../../../etc/passwd applies here as well since we don't have a filesystem here. But I guess we could normalize the input . I'm guessing this vulnerability happens or is exposed during development as that is when we use the filesystem to serve the files.

Any ideas, should we normalize the input path and remove ../../ at the beginning in this case?
@AzureMarker

from rust-embed.

acim avatar acim commented on July 19, 2024

Maybe check if canonical path starts with crate root? If not, reject it.

from rust-embed.

AzureMarker avatar AzureMarker commented on July 19, 2024

I thought we already patched this?

from rust-embed.

pyrossh avatar pyrossh commented on July 19, 2024

Yep just saw the code. It was implemented by you in this commit e1720ce

from rust-embed.

acim avatar acim commented on July 19, 2024

Can it just be that they have to recheck the project again? Maybe you should try to contact them as maintainers.

from rust-embed.

AzureMarker avatar AzureMarker commented on July 19, 2024

@pyrossh I think the issue is that we didn't release the impl crate for the last two versions. It's still on 6.2.0:
image

Edit: That or they mixed up the impl vs main crate versions.

from rust-embed.

pyrossh avatar pyrossh commented on July 19, 2024

@AzureMarker the latest impl crate version is v6.2.0. The crate versions don't need to match. I tried it myself and got the same. I have added a pants-ignore file for this vulnerability. We actually fixed this issue and published it for v6.2.0 of the impl crate.
6aafae6

from rust-embed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.