code-injection

Is this batch file injection?

江枫思渺然 提交于 2019-12-21 02:28:08
问题 C:\>batinjection OFF ^& DEL c.c batinjection.bat has contents of ECHO %* I've heard of SQL injection, though i've never actually done it, but is this injection? Are there different types of injection and this is one of them? Or is there another technical term for this? or a more specific term? Note - a prior edit had C:\>batinjection OFF & DEL c.c (i.e. without ^%) and ECHO %1 (i.e. without %*) which wasn't quite right. I have corrected it. It doesn't affect the answers. 回答1: Yes, it's a type

How to safely write JSON data to file using PHP

末鹿安然 提交于 2019-12-20 10:39:11
问题 I've got HTML form for editing images. All data is stored in JSON. When I change current image, I want to save changes, through PHP script, to a text file. If I return to previous image, this configuration will be send again from this file to the form. My question is: How to write/read this kind of data safely. Where and how effectively check data to prevent some JS/PHP code injections? I have attached some concept code below: JavaScript (using jQuery): // Writing $.ajax({ global: false, type

Enabling EJB Injection into Vaadin 7 UI via Usage of Vaadin-CDI-Integration Addon

本小妞迷上赌 提交于 2019-12-20 04:18:05
问题 I wasn't able to successfully integrate the official Vaadin-CDI-Integration-Addon, since after finishing the official integration instructions, the following Exception was thrown in case I reloaded the already published URL localhost:8080/App/?restartApplication . javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.IllegalStateException: UI id has already been defined The following little workaround is a tested, working solution, which completes the official

can a regex whitespace character cause an injection?

扶醉桌前 提交于 2019-12-20 02:12:10
问题 if I want to validate the input of a <textarea> , and want it to contain, for example, only numerical values, but even want to give users the possibility to insert new lines, I can selected wanted characters with a javascript regex that includes even the whitespace characters. /[0-9\s]/ The question is: do a whitecharacter can be used to perform injections, XSS,even if I think this last option is impossible, or any other type of attack ? thanks 回答1: /[0-9\s]/ should be a safe whitelist to use

@EJB injection vs lookup - performance issue

耗尽温柔 提交于 2019-12-19 19:49:31
问题 I have a question related with possible performance issue while using @EJB annotation. Imagine following scenario public class MyBean1 implements MyBean1Remote{ @EJB private MyBean2Remote myBean2; @EJB private MyBean2Remote myBean3; ... @EJB private MyBean20Remote myBean20; } There is a bean with many dependencies to other beans. According to EJB spec if I would like to inject MyBean1Remote to some other bean, container would have to take all required dependencies from its pool inject it into

How can I prevent variable injection in PowerShell?

二次信任 提交于 2019-12-19 04:01:12
问题 I was triggered again on a comment on a recent PowerShell question from @Ansgar Wiechers: DO NOT use Invoke-Expression with regards to a security question I have for a long time somewhere in the back of my mind and need to ask. The strong statement (with a reference to the Invoke-Expression considered harmful article) suggests that an invocation of a script that can overwrite variables is considered harmful. Also the PSScriptAnalyzer advises against using Invoke-Expression , see the

Easiest way to inject code to all methods and properties that don't have a custom attribute

断了今生、忘了曾经 提交于 2019-12-18 13:15:56
问题 There are a a lot of questions and answers around AOP in .NET here on Stack Overflow, often mentioning PostSharp and other third-party products. So there seems to be quite a range of AOP optons in the .NET and C# world. But each of those has their restrictions, and after downloading the promising PostSharp I found in their documentation that 'methods have to be virtual' in order to be able to inject code (edit: see ChrisWue's answer and my comment - the virtual constraint must have been on

Is Swift vulnerable to code injection?

时光毁灭记忆、已成空白 提交于 2019-12-18 11:22:47
问题 I was reading about Cycript and Cydia Substrate and how they can be used for code injection attacks on an iOS app. Code like this should scare you if you are working in a high security environment. (Ignore the /etc/password part, just consider the ability to replace originalMessage with crackedMessage .) cy# MS.hookFunction(fopen, function(path, mode) { cy> if (path == "/etc/passwd") cy> path = "/var/passwd-fake"; cy> var file = (*oldf)(path, mode); cy> log.push([path, mode, file]); cy>

Best way to inject functionality into a binary

非 Y 不嫁゛ 提交于 2019-12-18 10:43:03
问题 What would be the best way of inserting functionality into a binary application (3d party, closed source). The target application is on OSX and seems to have been compiled using gcc 3+. I can see the listing of functions implemented in the binary and have debugged and isolated one particular function which I would like to remotely call. Specifically, I would like to call this function - let's call it void zoomByFactor(x,y) - when I receive certain data from a complex HIDevice. I can easily

doctrine2 dql, use setParameter with % wildcard when doing a like comparison

南楼画角 提交于 2019-12-18 10:40:56
问题 I want to use the parameter place holder - e.g. ?1 - with the % wild cards. that is, something like: "u.name LIKE %?1%" (though this throws an error). The docs have the following two examples: 1. // Example - $qb->expr()->like('u.firstname', $qb->expr()->literal('Gui%')) public function like($x, $y); // Returns Expr\Comparison instance I do not like this as there is no protection against code injection. 2. // $qb instanceof QueryBuilder // example8: QueryBuilder port of: "SELECT u FROM User u