Questions tagged [code-injection]

Code injection refers to the overall outcome that arises from an absence or incorrect application of neutralization techniques on certain special components within externally-influenced input. This could potentially lead to alterations in the syntax or behavior of the intended code.

Fortified CakePHP: Defeating SQL Injection in Validation

I recently added a plugin called "SQL Inject Me" to my Firefox browser and decided to test it on my Cakephp website. To my surprise, the plugin was able to inject several blank user accounts, some with passwords and some without. This is strange because I ...

Stop JavaScript Injection Attacks

Let's consider a scenario where a user inputs information into a form that is then submitted to the server using PHP. In the PHP code, we have: $data = $_POST['data']; // or $data = strip_tags(@$_POST['data']); I am curious t ...

peculiar coding in HTML (HTML_ASG HTML_TAG, SYN_BLK, JS_ACV, etc..)

I created a website for a client and everything was working perfectly on my end. However, they are experiencing errors on 3 of their Windows machines running IE8 where the ElementById cannot be found. Upon inspecting the html-source, I discovered that ther ...

Is it possible to implement dependency injection within a .css document?

I have a C# .NET 6 application. Some of the web pages (Razor Pages) in the app use dependency injection to inject configuration into the Razor Pages (.cshtml files), allowing certain config elements to be displayed in the user interface. My query is, can ...

Change the behavior of a submit button to trigger a custom JavaScript function instead

I am faced with a challenge where I need to override the default functionality of a button in code that cannot be altered. Instead, I must ensure that when the button is clicked, a custom JavaScript method is called rather than submitting the form as it no ...

The AngularJS dependency injection system allows developers to easily manage dependencies using arrays and the $inject

Being new to angularJS, I'm seeking some insight on dependency injection. After some research, here's what I've gathered: I have 2 service files (using factories): -mogService.js angular.module('anglober.services').factory('mogService', ['$http', funct ...

I am struggling to comprehend the concept of dependency injection. Is there anyone available to provide a clear explanation for me?

I am working on a NestJS application and trying to integrate a task scheduler. One of the tasks involves updating data in the database using a UserService as shown below: import { Injectable, Inject, UnprocessableEntityException, HttpStatus, } fro ...

What steps can I take to safeguard my database from potential mySQL injections

I've been researching how to prevent SQL injection in our database, but I haven't found a definitive answer. It seems like using mysql_real_escape_string for MySQL or PDO for other databases are common suggestions. When inserting user input into ...

Tips for safeguarding AJAX or javascript-based web applications

Utilizing AJAX, this function retrieves information about an image in the database with the ID of 219 when a button is clicked. Any visitor to this webpage has the ability to alter the JavaScript code by inspecting the source code. By modifying the code a ...

Adding Bootstrap component via ajax request

I'm facing an issue with injecting a Bootstrap component using ajax. I usually include a select element like this: <select class="selectpicker" data-width="75%"> Most of the HTML code is generated dynamically through javascript, which you can refer ...

Streamline the process of filtering injections

One of the challenges I face is manually filtering POST and GET input on several PHP pages to prevent injection. I'm wondering if there's a way to automatically filter every POST and GET my page receives using *mysql_real_escape_string*? ...