security

x-power-by display in response header

拈花ヽ惹草 提交于 2020-01-25 04:42:21
问题 As per the security of web application x-power-by should set to empty when it displays in response header.. In our application we did this by implementing a filter. public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // App specific logic... HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader("X-Powered-By",""); chain.doFilter(request, response); httpResponse.setHeader("X-Powered

Prevent user from manipulating query string parameter

牧云@^-^@ 提交于 2020-01-25 04:26:08
问题 Situation: Unregistered user visits website and issues a request for an item. As per the current data flow, this request gets inserted in db first and the request id is carried over in the url of the subsequent pages henceforth( where user gets to add in further info). Problem: User can change the id. What i have done so far: As soon as i retrieve the id after request is inserted by using lastInsertId(), i store it inside a session variable and check in the subsequent pages against the id

How do I hide a file inside an image with Python?

旧城冷巷雨未停 提交于 2020-01-25 01:53:07
问题 I know it's possible in Batch using the 'copy' command with the '/B' switch, i.e.: copy /B imagefile+hiddenfile newfile My question is this; Is it possible to do this in Python, and if so, how? This question is very similar, and it's answer is acceptable, but I am still curious; Is there a way to do this without the stepic module? 回答1: You don't need stepic for that. >>> out = file("out.jpg", "wb") >>> out.write(file("someimage.jpg", "rb").read()) >>> out.write(file("somehiddenfile.pdf", "rb"

How do I hide a file inside an image with Python?

风流意气都作罢 提交于 2020-01-25 01:52:12
问题 I know it's possible in Batch using the 'copy' command with the '/B' switch, i.e.: copy /B imagefile+hiddenfile newfile My question is this; Is it possible to do this in Python, and if so, how? This question is very similar, and it's answer is acceptable, but I am still curious; Is there a way to do this without the stepic module? 回答1: You don't need stepic for that. >>> out = file("out.jpg", "wb") >>> out.write(file("someimage.jpg", "rb").read()) >>> out.write(file("somehiddenfile.pdf", "rb"

SSL and Session Hijacking/Fixation

久未见 提交于 2020-01-25 00:58:26
问题 Quick question. Does SSL totally prevent session hijacking/fixation? Thanks. 回答1: No. Hijacking may be done for example in these scenarios: Hacked CA root signs invalid certificates. The certificate may be used to stage man-in-the-middle attacks. Hacked domain owner e-mail inbox makes it possible for the hacker to buy a domain-validated certificate. Bad key policies may make it possible for an attacker to gain the private key for the certificate. A local attack on the client computer may make

Deny access to directory in IIS 6.0

核能气质少年 提交于 2020-01-25 00:31:05
问题 How can I deny access to particular directory in IIS. In Apache I could just add .htaccess file: Order allow,deny Deny from all to Logs or cache directory and nobody will allowed to see any content in that directory. However when I add Web.config: <?xml version="1.0"?> <configuration> <system.web> <authorization> <deny users="*"/> </authorization> </system.web> </configuration> it works only for files handled by asp and doesn't work for i.e. log.txt. I don't have access to IIS server, I can

How to skip the questions when using FileConnection?

限于喜欢 提交于 2020-01-25 00:16:14
问题 I want to display photos stored in the phone , and I use the FileConnection and the openInputStream stuff. The problem is that there are many questions that I must accept when launching the program ; they are all about access to the file system or a particular file. So how to "skip" these questions , that is accept all of them programmatically, so they do not appear when launching the application ? 回答1: Basically this type of alerts asking for security purpose. Because you are using

is it bad to pass jwt token as part of url?

落花浮王杯 提交于 2020-01-24 23:02:53
问题 Hi currently i have an angular application and java backend. in my angular component html i have some image such as profile photos. the resource that serves the image files is secured with spring security . so my quesiton is it bad to append json web tokens as part of an image url ? can it cause a security breach ? is it a bad practice ? the following is how my angular code looks like from the chrome developer tool. <div _ngcontent-c5="" class="avatar-circle bg-secondary text-brand-secondary"

User-files organization in a Web server

感情迁移 提交于 2020-01-24 22:44:27
问题 I'm developing a Web application where users can upload files. Suppose to have different file categories, e.g. audio and docs . I guess I can put all the files that belongs from a category in a unique folder, e.g.: audio_dir -file_from_user1.mp3 -another_file_from_user1.mp3 -file_from_user2.mp3 -file_from_user4.mp3 docs_dir -file_from_user1.doc -file_from_user5.pdf The other solution I'm evaluating uses a third level, where files are grouped by users. audio_dir user1_dir -file_from_user1.mp3

Refused to display in a frame because an ancestor violates the following Content Security Policy directive

混江龙づ霸主 提交于 2020-01-24 22:15:11
问题 I am developing a salesforce app which is rendered inside an iframe in salesforce page. Using node express server to render this page. As part of security review, i want to render only in salesforce page and block if embedded anywhere else. For that, i have added content-security-policy header as below: response.header("Content-Security-Policy", "frame-ancestors salesforce.com"); But it is blocked on salesforce page too. Error : Refused to display 'https://localhost:8000/authenticate' in a