Category: 

What Is a Code Injection?

Article Details
  • Written By: Alex Newth
  • Edited By: Angela B.
  • Last Modified Date: 26 August 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The atmosphere of Jupiter's moon Io collapses every time it is eclipsed by the planet.   more...

September 29 ,  2008 :  The Dow Jones Industrial Average experienced its largest one-day drop in history.  more...

Code injection is a method hackers use to inject malicious code into a website or program that contains a security weakness. This code then changes the entire website or program — or destroys it — depending on what code was injected. A code injection attack happens most often when an administrator does not add rules restricting the use of certain characters found in injection attacks. While usually malicious, injecting code can reap good results and can be done accidentally.

A code injection is a type of attack on a program’s or website’s original coding. The hacker will go into the digital space and insert a code that allows malevolent programming to enter the digital space, bending it to his or her will. Injecting the code can cause many different results, such as introducing malware, allowing the hacker to access private information, enabling the hacker to steal cookies and session data, or just destroying the original coding and rendering the website or program useless.

One of the simplest ways for a hacker to enter a virtual space is from a guestbook or user input function. If the administrator does not limit the use of characters or does not restrict characters commonly used during a code injection, then the hacker can type in the injection code. When someone views the injection, it will enter his or her computer, and the injection will propagate. This threat means administrators need to control user input very carefully.

Ad

While code injection attacks are nearly always malicious, there are some good reasons to launch one. For example, perhaps a software programmer created a program that is difficult to upgrade, but the program desperately needs to have some coding rearranged or added. Instead of attempting a regular upgrade, which can take a long time, he or she can inject the new code into the program. This quickly alters the code, but in a good way, adding or fixing a feature in the program.

Code injection also can occur by accident. If the administrator does not limit character use and someone uses a character that has a special meaning for the programming language, it can cause the language to mess up. This is because the programming language sees the character as one that should create a function but, since there is no coding for that function, the language does not know what to do and glitches. The website will then display erratic symbols instead of the website itself. If the user attaches a bad file by accident, this can cause a similar problem.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}