Is code injection possible in Java?

前端 未结 8 2004
谎友^
谎友^ 2021-02-04 07:17

nowadays you can read much about code injection, exploits, buffer-, stack- and heap-overflows etc. leading to inject and run code. I wonder what of this stuff is relevant for Ja

8条回答
  •  时光取名叫无心
    2021-02-04 07:26

    A java program itself is pretty much not vulnerable to code injection. However, all the native code that supports the app is vulnerable to all the different kinds of code injection - this includes the JVM and all native code parts in the app or its libraries.

    Also, there are a few more things to consider:

    Anything where java is used as a gateway to other systems is possible:

    SQL Injection

    XSS (which is in the end nothing more than JavaScript Injection)

    If the java program is itself a interpreter/compiler of some kind, it might be possible to inject code into your interpreted language/compiled program (this includes using your program as a java compiler...)

    And of course if you can get the java program to write a file to disk that contains code (be it native, java or something else) you might be able to get it executed by other means (which can be a different vulnerability in your app, the os or another app) - this is not direct code injection but quite similar in effect.

提交回复
热议问题