Index: wp-includes/shortcodes.php
===================================================================
--- wp-includes/shortcodes.php	(revision 18534)
+++ wp-includes/shortcodes.php	(working copy)
@@ -259,9 +259,10 @@
  *
  * @param array $pairs Entire list of supported attributes and their defaults.
  * @param array $atts User defined attributes in shortcode tag.
+ * @param string $shortcode Optional. The name of the shortcode, provided for context to enable filtering
  * @return array Combined and filtered attribute list.
  */
-function shortcode_atts($pairs, $atts) {
+function shortcode_atts( $pairs, $atts, $shortcode = '' ) {
 	$atts = (array)$atts;
 	$out = array();
 	foreach($pairs as $name => $default) {
@@ -270,6 +271,10 @@
 		else
 			$out[$name] = $default;
 	}
+
+	if ( ! empty( $shortcode ) )
+		$out = apply_filters( 'shortcode_atts_' . $shortcode, $out, $pairs, $atts );
+
 	return $out;
 }
 
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 18534)
+++ wp-includes/media.php	(working copy)
@@ -731,7 +731,7 @@
 		'align'	=> 'alignnone',
 		'width'	=> '',
 		'caption' => ''
-	), $attr));
+	), $attr, 'caption'));
 
 	if ( 1 > (int) $width || empty($caption) )
 		return $content;
@@ -784,7 +784,7 @@
 		'size'       => 'thumbnail',
 		'include'    => '',
 		'exclude'    => ''
-	), $attr));
+	), $attr, 'gallery'));
 
 	$id = intval($id);
 	if ( 'RAND' == $order )
