Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
McGlockenshire
Dec 16, 2005

GOLLOCKS!
I'm not sure I fully understand what's going on here, but http://1337day.com/exploits/18984

This is allegedly Javascript that exploits a bug in one or more models of the Intel Core 2 Duo processor line to achieve ... something. The details on what it's doing, why, and what it actually gets done isn't clear to me. They're calling it "root."

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
It's overwriting stuff in the instruction cache, which is potentially even better than getting root as it could let you run code as the hypervisor and break out of a vm. I'm not sure what the PoC code actually does.

McGlockenshire
Dec 16, 2005

GOLLOCKS!
That's... frightening. 3/4 of the workstations I manage are one of a few types of Core 2 Duo.

Vanadium
Jan 8, 2005

Didn't do anything on my core 2 duo. :(

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"

Vanadium posted:

Didn't do anything on my core 2 duo. :(
The comments indicate that it takes a long time, potentially over an hour.

I don't understand why he wrote it in Javascript. While it does make for a more frightening headline, using JS also makes reproduction *much* more difficult. Reliably generating the same sequence of instructions is dependent on the exact browser/VM versions, and he doesn't specify any.

gibbed
Apr 10, 2006

Janin posted:

The comments indicate that it takes a long time, potentially over an hour.
The code that runs the test doesn't try to repeatedly call anything and it says my Core2Duo is not buggy in Opera/IE. If this exploit actually does function somehow, time to upgrade. :bang: It screams bullshit though.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
That particular JS is from some guy who tried porting a C exploit to Javascript while having little idea what he was doing, what the differences between the languages were, or even how the original exploit worked.

The original exploit, though, is a little more interesting (or at least, "actually plausible"). Compromising the host system once you've gained access to a VPS on the box is a pretty worrying possibility, and it's even possible (depending on how specific the conditions need to be to trigger the bug) that it could be triggered from a script similar to how a jit spray works (though there it'd probably be targeting Flash rather than javascript).

Jabor fucked around with this message at 09:27 on Jul 15, 2012

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
That JS "exploit" is poo poo. He tries adding an object to a number, thinking it's a pointer. He tries to xor a function and a number together. He calls a dummy, blank function and thinks it will do something, as long as you pass it a magic number, 257*3. He calls unescape like it has some magic voodoo powers that will turn a return value into something else.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Whenever you see comments left in an exploit like "It doesn't work. Now it does! Or does it?" that alone should be a strong indicator that it's crap.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
The author of the C exploit, Kris Kaspersky/nezumi, gave a talk on the issue: PDF of slides

And on a WASM Forum thread about him/his exploit, he linked the full exploit file including required micro.dat.

e: Here's the video of his talk, talk starts at 1:10.

Malloc Voidstar fucked around with this message at 14:51 on Jul 15, 2012

Byte Salad
Dec 21, 2005

Just found this wonder at work, sitting in it's own JS file...

code:
function DocumentWrite( Html ) { document.write( Html ); }

Look Around You
Jan 19, 2009

Byte Salad posted:

Just found this wonder at work, sitting in it's own JS file...

code:
function DocumentWrite( Html ) { document.write( Html ); }

He's just trying to reduce code size though!

theratking
Jan 18, 2012
at the startup I'm working for we recently got a batch of new hires. A new designer modified some css class attributes without even *thinking* about what other elements share the class. The site got trashed...

Strong Sauce
Jul 2, 2003

You know I am not really your father.





theratking posted:

at the startup I'm working for we recently got a batch of new hires. A new designer modified some css class attributes without even *thinking* about what other elements share the class. The site got trashed...

It's okay because you're under version control right? RIGHT???

theratking
Jan 18, 2012

Strong Sauce posted:

It's okay because you're under version control right? RIGHT???

haha yes thank jesus. Although the times I've found commits with HEAD >>>> poo poo in it... *sigh*

McGlockenshire
Dec 16, 2005

GOLLOCKS!

theratking posted:

haha yes thank jesus. Although the times I've found commits with HEAD >>>> poo poo in it... *sigh*

You need a better precommit hook. There are still advantages to centralized version control...

theratking
Jan 18, 2012

McGlockenshire posted:

You need a better precommit hook. There are still advantages to centralized version control...

We don't have any pre-commit hooks. This entire startup is a horror. Our dev team (aside from myself) basically quit this summer and all the new hires have never done web-dev before. I was the most inexperienced member of the team and now I'm "head programmer." I know I can't really expect much more, our boss just graduated college and we're all college level (I just finished my freshman year), but geez... I need to vent sometimes.

Optimus Prime Ribs
Jul 25, 2007

Don't know if this counts as a "coding horror" but it's pretty drat stupid.
At work we use OpenDNS, and I just went onto jsfiddle and was greeted with this:



:catstare:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Optimus Prime Ribs posted:

Don't know if this counts as a "coding horror" but it's pretty drat stupid.
At work we use OpenDNS, and I just went onto jsfiddle and was greeted with this:



:catstare:

A site that lets me host pages for free without any setup? That honestly sounds like the best way to phish.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
It's why PasteHTML was blocked by a shitload of ISPs for a while.

Zamujasa
Oct 27, 2010



Bread Liar
Boss, boss, boss...

php:
<?
#!/usr/bin/php
<?
while(1){
$line = fgets(STDIN);
$pos = strrpos($line, "~", 0);
if ($pos !== false){


$puke = Chr(13) . chr(13).chr(10);
$puke .= "big steaming lump";
$puke .= "  of hand-rolled xml";
$puke .= "  right here";
$puke .= "puke";
$puke .= Chr(10);

echo $puke;
}
//echo $line;
}
?>?>
code:
sigh@server:~$ ps aux | grep 'puke'
root     30490 98.9  0.4 157080  9396 ?        Rs   Jul11 7873:29 /usr/bin/php /var/puke.php
root     19158 98.8  0.4 157080  9396 ?        Rs   Jul12 7484:50 /usr/bin/php /var/puke.php
root     20226 98.8  0.4 157080  9396 ?        Rs   Jul11 8048:30 /usr/bin/php /var/puke.php
root     29378 98.8  0.4 157080  9392 ?        Rs   Jul11 7882:55 /usr/bin/php /var/puke.php
:sigh:

Optimus Prime Ribs
Jul 25, 2007

I just got assigned just about the most retarded task imaginable:

We need to have a bunch of SWF objects which act as slides for a presentation; they contain text transitions and whatnot. These need to be pushed live, and the only way our platform can do that is to stick it in an iframe, and then on that page periodically check if a new SWF should be shown.

On those SWF objects is a black box where an SWF player (which is playing a live stream) needs to be absolutely positioned over, but that cannot go in the iframe as each slide change will gently caress up the stream, so I need to position it over the iframe. And then that page is going into another iframe.

:suicide:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Aleksei Vasiliev posted:

It's why PasteHTML was blocked by a shitload of ISPs for a while.

MSM still blocks it :v:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Optimus Prime Ribs posted:

I just got assigned just about the most retarded task imaginable:

We need to have a bunch of SWF objects which act as slides for a presentation; they contain text transitions and whatnot. These need to be pushed live, and the only way our platform can do that is to stick it in an iframe, and then on that page periodically check if a new SWF should be shown.

On those SWF objects is a black box where an SWF player (which is playing a live stream) needs to be absolutely positioned over, but that cannot go in the iframe as each slide change will gently caress up the stream, so I need to position it over the iframe. And then that page is going into another iframe.

:suicide:
Sounds kind of fun really :buddy:

Zombywuf
Mar 29, 2008

code:
~$ pydoc syslog.openlog
Help on built-in function openlog in syslog:

syslog.openlog = openlog(...)
~$

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
I think SyntaxError: Invalid syntax is a more legitimate concern

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Otto Skorzeny posted:

I think SyntaxError: Invalid syntax is a more legitimate concern

syslog.openlog = openlog(...) is perfectly valid syntax in Python 3.

Opinion Haver
Apr 9, 2007

What's the ... do?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Slicing

http://docs.python.org/release/2.5.2/lib/bltin-ellipsis-object.html

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Suspicious Dish posted:

syslog.openlog = openlog(...) is perfectly valid syntax in Python 3.

You've misunderstood me. I was complaining that CPython's syntax errors are spectacularly unhelpful to novices and that this is a worse problem than Zombywuf's quibbles with pydoc, not that the statement Zombywuf referenced in his complaint about pydoc contained a syntax error.

ToxicFrog
Apr 26, 2008


Otto Skorzeny posted:

You've misunderstood me. I was complaining that CPython's syntax errors are spectacularly unhelpful to novices and that this is a worse problem than Zombywuf's quibbles with pydoc, not that the statement Zombywuf referenced in his complaint about pydoc contained a syntax error.

You think that's an unhelpful error message?

Ladies and gentlemen, I give you...Clojure!

code:
Exception in thread "main" java.lang.RuntimeException: No such namespace: writer, compiling:(ca/ancilla/kessler/core.clj:7)
	at clojure.lang.Compiler.analyze(Compiler.java:6281)
	at clojure.lang.Compiler.analyze(Compiler.java:6223)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3497)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6457)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyze(Compiler.java:6223)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3548)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6457)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyze(Compiler.java:6223)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5618)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5054)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3674)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6453)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6443)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.access$100(Compiler.java:37)
	at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:518)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6455)
	at clojure.lang.Compiler.analyze(Compiler.java:6262)
	at clojure.lang.Compiler.analyze(Compiler.java:6223)
	at clojure.lang.Compiler.compile1(Compiler.java:7030)
	at clojure.lang.Compiler.compile(Compiler.java:7097)
	at clojure.lang.RT.compile(RT.java:387)
	at clojure.lang.RT.load(RT.java:427)
	at clojure.lang.RT.load(RT.java:400)
	at clojure.core$load$fn__4890.invoke(core.clj:5415)
	at clojure.core$load.doInvoke(core.clj:5414)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invoke(core.clj:5227)
	at clojure.core$compile$fn__4895.invoke(core.clj:5426)
	at clojure.core$compile.invoke(core.clj:5425)
	at user$eval7.invoke(NO_SOURCE_FILE:1)
	at clojure.lang.Compiler.eval(Compiler.java:6511)
	at clojure.lang.Compiler.eval(Compiler.java:6501)
	at clojure.lang.Compiler.eval(Compiler.java:6477)
	at clojure.core$eval.invoke(core.clj:2797)
	at clojure.main$eval_opt.invoke(main.clj:297)
	at clojure.main$initialize.invoke(main.clj:316)
	at clojure.main$null_opt.invoke(main.clj:349)
	at clojure.main$main.doInvoke(main.clj:427)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:419)
	at clojure.lang.AFn.applyToHelper(AFn.java:163)
	at clojure.lang.Var.applyTo(Var.java:532)
	at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: No such namespace: writer
	at clojure.lang.Util.runtimeException(Util.java:170)
	at clojure.lang.Compiler.resolveIn(Compiler.java:6736)
	at clojure.lang.Compiler.resolve(Compiler.java:6710)
	at clojure.lang.Compiler.analyzeSymbol(Compiler.java:6671)
	at clojure.lang.Compiler.analyze(Compiler.java:6244)
	... 56 more
Yes, that is a 65-line error message (or rather, the first 65 lines of a 121-line error message). Of those lines, only two are actually relevant, the rest being compiler internals, and one of them is a less detailed duplicate of the other.

If you're clever you can get it to emit error messages that are just as long but don't even tell you what file the error is in.

I love Clojure but jesus christ its compiler needs work.

PrBacterio
Jul 19, 2000

ToxicFrog posted:

You think that's an unhelpful error message?

Ladies and gentlemen, I give you...Clojure!

code:
...
Yes, that is a 65-line error message (or rather, the first 65 lines of a 121-line error message). Of those lines, only two are actually relevant, the rest being compiler internals, and one of them is a less detailed duplicate of the other.

If you're clever you can get it to emit error messages that are just as long but don't even tell you what file the error is in.

I love Clojure but jesus christ its compiler needs work.
That sounds more like the compiler just threw and exception and then decided to just dump the exception's toString() value on the console than an actual compiler error message :stare:

ToxicFrog
Apr 26, 2008


PrBacterio posted:

That sounds more like the compiler just threw and exception and then decided to just dump the exception's toString() value on the console than an actual compiler error message :stare:

It does, doesn't it? And in fact I have legit crashed the compiler once or twice. But this is also what a normal compiler error looks like.

The errors you get out of the interpreter are much more sensible, thank god, it's only the compiler that shits itself when something goes wrong.

Doctor w-rw-rw-
Jun 24, 2008

ToxicFrog posted:

It does, doesn't it? And in fact I have legit crashed the compiler once or twice. But this is also what a normal compiler error looks like.

The errors you get out of the interpreter are much more sensible, thank god, it's only the compiler that shits itself when something goes wrong.

Looks to me like someone wrote the analyzer recursively. So it's not totally weird, at least, though it is unhelpful.

Opinion Haver
Apr 9, 2007

gently caress whoever decided that a protobuf with a field set to its default value shouldn't equal a protobuf with that field unset. gently caress them hard.

Look Around You
Jan 19, 2009

ToxicFrog posted:

You think that's an unhelpful error message?

Ladies and gentlemen, I give you...Clojure!

code:
Exception in thread "main" java.lang.RuntimeException: 
SNIP
Yes, that is a 65-line error message (or rather, the first 65 lines of a 121-line error message). Of those lines, only two are actually relevant, the rest being compiler internals, and one of them is a less detailed duplicate of the other.

If you're clever you can get it to emit error messages that are just as long but don't even tell you what file the error is in.

I love Clojure but jesus christ its compiler needs work.

It's also only a 1-pass compiler, which I only found out after asking for help in the lisp thread because there's pretty much no documentation of it only being 1-pass at all. Also a functional language that flips poo poo because functions aren't defined in the right order is loving stupid and very counter-productive.

Scaevolus
Apr 16, 2007

yaoi prophet posted:

gently caress whoever decided that a protobuf with a field set to its default value shouldn't equal a protobuf with that field unset. gently caress them hard.

Protobufs are nice as a serialization format, but using them beyond that can be ugly-- storing an AST in protobufs and evaluating the protobuf directly feels dirty.

Elos
Jan 8, 2009

One guy in the firm I'm interning really doesn't understand the point of exceptions. There's tons of methdos that just throw a plain Exception and I have to go balls deep to find out what the hell it's actually throwing and fixing it so I can actually do something about it.

Catchin'n'logging seems to be his thing too. :eng99:

..btt
Mar 26, 2008

Elos posted:

exceptions

One of the apps I have the displeasure of maintaining has configurable exception propagation, so when you're testing exceptions are correctly propagated, but when deployed in "production mode" it logs them then silently eats them and returns some random value instead. And when I say it logs them, I mean it logs the message but none of the details.

I'm scared to fix this (which would be many weeks of work in itself) in case it breaks something on the live sites.

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Reasons Python drives me up the loving wall #2398457:

There are handy methods for encoding and decoding strings into different character encodings, which even support handling errors, that is characters which do not exist in the current encoding. The 3 built in error handlers are: ignore, replace with '?' and replace with an xml character reference.

How does Python dump non ascii characters to the console (and it is non ascii because it doesn't bother looking at your locale settings unless you tell it to)? Like this: '\xff'. If I want to do that I have to register my own error handler, note that is literally installing an error handler into the runtime, not just passing an error handling function to the encode method.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply