danger - Dave's Blog

Search
My timeline on Mastodon

Retweet of imelven

2015 Apr 11, 10:19
Naming is important: in Rails you can output raw unescaped HTML with .safe_html - in React a similar API is called dangerouslySetInnerHTML
PermalinkComments

WinRT PropertySet Changed Event Danger

2013 Jul 8, 1:46

The Windows Runtime API Windows.Foundation.Collections.PropertySet class​ is a nice string name to object value map that has a changed event that fires when the contents of the map is modified. Be careful with this event because it fires synchronously from the thread on which the PropertySet was modified. If modified from the UI thread, the UI thread will then wait as it synchronously dispatches the changed event to all listeners which could lead to performance issues or especially from the UI thread deadlock. For instance, deadlock if you have two threads both trying to tell each other about changed events for different PropertySets.

PermalinkCommentsdeadlock development propertyset windows windows-runtime winrt

Kim Dotcom’s Megabox: Music service or malware? | Ars Technica

2012 Sep 26, 6:40

Megabox is an ad-replacer - replacing ads on the web as you browse with its own. Ignoring security concerns, I hope this doesn’t result in over prescriptive laws that endanger things like Greasemonkey.

To listen to songs through Megabox, users will have two options—purchasing the music through the service, or installing “Megakey” software onto their computer to listen for free. The Megakey software, as Dotcom explained to Torrentfreak, acts like ad-blocking software—except that it isn’t. Megakey allows most advertisements to appear, but replaces about 15 percent of the ads served up by websites with ads hosted by Megabox.

PermalinkCommentstechnical music ad mega megadotcom megabox

Stripe CTF - XSS, CSRF (Levels 4 & 6)

2012 Sep 10, 4:43

Level 4 and level 6 of the Stripe CTF had solutions around XSS.

Level 4

Code

> Registered Users 

    <%@registered_users.each do |user| %>
    <%last_active = user[:last_active].strftime('%H:%M:%S UTC') %>
    <%if @trusts_me.include?(user[:username]) %>

  • <%= user[:username] %>
    (password: <%= user[:password] %>, last active <%= last_active %>)
  • Issue

    The level 4 web application lets you transfer karma to another user and in doing so you are also forced to expose your password to that user. The main user page displays a list of users who have transfered karma to you along with their password. The password is not HTML encoded so we can inject HTML into that user's browser. For instance, we could create an account with the following HTML as the password which will result in XSS with that HTML:

    
    
    This HTML runs script that uses jQuery to post to the transfer URI resulting in a transfer of karma from the attacked user to the attacker user, and also the attacked user's password.

    Notes

    Code review red flags in this case included lack of encoding when using user controlled content to create HTML content, storing passwords in plain text in the database, and displaying passwords generally. By design the web app shows users passwords which is a very bad idea.

    Level 6

    Code

    
    

    ...

    def self.safe_insert(table, key_values)
    key_values.each do |key, value|
    # Just in case people try to exfiltrate
    # level07-password-holder's password
    if value.kind_of?(String) &&
    (value.include?('"') || value.include?("'"))
    raise "Value has unsafe characters"
    end
    end

    conn[table].insert(key_values)
    end

    Issue

    This web app does a much better job than the level 4 app with HTML injection. They use encoding whenever creating HTML using user controlled data, however they don't use encoding when injecting JSON data into script (see post_data initialization above). This JSON data is the last five most recent messages sent on the app so we get to inject script directly. However, the system also ensures that no strings we write contains single or double quotes so we can't get out of the string in the JSON data directly. As it turns out, HTML lets you jump out of a script block using no matter where you are in script. For instance, in the middle of a value in some JSON data we can jump out of script. But we still want to run script, so we can jump right back in. So the frame so far for the message we're going to post is the following:

    
    
    
    
PermalinkCommentscsrf encoding html internet javascript percent-encoding script security stripe-ctf technical web xss

Stripe Web Security CTF Summary

2012 Aug 30, 5:00

I was the 546th person to complete Stripe's web security CTF and again had a ton of fun applying my theoretical knowledge of web security issues to the (semi-)real world. As I went through the levels I thought about what red flags jumped out at me (or should have) that I could apply to future code reviews:

Level Issue Code Review Red Flags
0 Simple SQL injection No encoding when constructing SQL command strings. Constructing SQL command strings instead of SQL API
1 extract($_GET); No input validation.
2 Arbitrary PHP execution No input validation. Allow file uploads. File permissions modification.
3 Advanced SQL injection Constructing SQL command strings instead of SQL API.
4 HTML injection, XSS and CSRF No encoding when constructing HTML. No CSRF counter measures. Passwords stored in plain text. Password displayed on site.
5 Pingback server doesn't need to opt-in n/a - By design protocol issue.
6 Script injection and XSS No encoding while constructing script. Deny list (of dangerous characters). Passwords stored in plain text. Password displayed on site.
7 Length extension attack Custom crypto code. Constructing SQL command string instead of SQL API.
8 Side channel attack Password handling code. Timing attack mitigation too clever.

More about each level in the future.

PermalinkCommentscode-review coding csrf html internet programming script security sql stripe technical web xss

ifc: This week on Comedy Bang! Bang! - Michael Cera!

2012 Jun 27, 3:38


ifc:

This week on Comedy Bang! Bang! - Michael Cera!

PermalinkCommentshumor comedy-bang-bang michael-cera video

(via M Thru F: Remember, Extrapolation is Dangerous)

2011 Nov 15, 11:54


(via M Thru F: Remember, Extrapolation is Dangerous)

PermalinkCommentshumor ice

Coding Horror: You're Reading The World's Most Dangerous Programming Blog

2010 Jan 20, 8:28GZip vs Deflate execution speeds. Deflate found to be much faster in particular cases and about the same in the rest.PermalinkCommentsgzip deflate performance technical http compression programming development blog

Hey Okay » Danger!

2009 Nov 13, 9:47
PermalinkCommentsdanger sign robot robots humor

Anyone can write this crap (Phil Gyford’s website)

2009 Jul 31, 5:57"Is it worth the sensationalism and scaremongering? The endlessly inaccurate and dangerous science reporting? The pointless and news-free lifestyle articles? Do newspapers that prioritise stories based on celebrities and spectacle rather than importance to the world deserve to exist?"PermalinkCommentsvia:sambrook internet news journalism media

The WHATWG Blog - Blog Archive - This Week in HTML 5 - Episode 20

2009 Feb 3, 11:15"r2719 specifies that browsers should not allow scripts to set document.domain to anything on the Public Suffix List, such as "com" or "co.jp". Essential background reading on why this is dangerous: Untraceable XSS Attacks. Most browsers already block this attack, e.g. Firefox since 3.0. [Background: Re: Setting document.domain]"PermalinkCommentshtml5 tld publicsuffix dns security html internet web reference w3c

Danger to Life

2008 Dec 26, 12:27

sequelguy posted a photo:

Danger to Life

The English portions of the signs read "dangerous. Climbing on and over the balustrades and railings stictly prohibited. Daner to Life! Any violation will result in criminal prosecution!"

PermalinkCommentssign germany munich olympictower

Sam Kass's Blog

2008 Nov 17, 8:21"The organization is now five years old, and our membership is larger than ever. It is estimated that one out of every four people on Earth is now a devoted member. The secret language has been perfected-- it allows us to talk freely, and sounds just like normal small talk. Also, we have an order of special agents who are particularly dangerous, and are all disguised as normal people. Our goal is the annihilation of all paranoid people."PermalinkCommentshumor club paranoia sam-kass

STGC Enumeration (Windows)

2008 Oct 1, 1:49One of the values in this enum is named 'STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE'. After reading (and re-reading to make sure I word broke correctly) I'm left with the lingering impression that I've had an extensive conversation with whoever named this variable. Anyway, I thought it was a fun name.PermalinkCommentshumor software msdn microsoft reference

RFC 3675 - .sex Considered Dangerous

2008 Jun 30, 3:55FCC wants nationwide free wifi that's free of porn. They should read this. "Periodically there are proposals to mandate the use of a special top level name or an IP address bit to flag "adult" "unsafe" material or the like. This document explains why thiPermalinkCommentsdomain dns rfc ietf internet porn government politics censorship

DEEP TIME, Part I, by Gregory Benford

2008 Feb 2, 5:49A story of a program to bury nuclear waste that remains dangerous for 24k years and the associated challenges.PermalinkCommentsfuture science time art nuclear government nuclear-waste

Crocodile danger - very clear warning

2007 Oct 3, 12:17Humorous crocodile danger sign.PermalinkCommentshumor sign crocodile photo photos
Older Entries Creative Commons License Some rights reserved.